summaryrefslogtreecommitdiff
path: root/libavcodec/h261.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-10-28 18:42:31 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-28 18:42:31 +0000
commit5bbad3eb530b48db9ba1acd3938f08729be63150 (patch)
tree95abad45cadc4ab3ebe4afb48b3e9b82f7c8a081 /libavcodec/h261.c
parent87b9e6b2dd32cff996532f5a0485befd672510a2 (diff)
downloadffmpeg-5bbad3eb530b48db9ba1acd3938f08729be63150.tar.gz
cleanup
Originally committed as revision 3650 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h261.c')
-rw-r--r--libavcodec/h261.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libavcodec/h261.c b/libavcodec/h261.c
index 8b73f387c4..f1e5845481 100644
--- a/libavcodec/h261.c
+++ b/libavcodec/h261.c
@@ -325,8 +325,7 @@ static void h261_encode_block(H261Context * h, DCTELEM * block, int n){
i = 1;
} else if((block[0]==1 || block[0] == -1) && (s->block_last_index[n] > -1)){
//special case
- put_bits(&s->pb,1,1);
- put_bits(&s->pb,1,block[0]>0 ? 0 : 1 );
+ put_bits(&s->pb,2,block[0]>0 ? 2 : 3 );
i = 1;
} else {
i = 0;
@@ -354,12 +353,7 @@ static void h261_encode_block(H261Context * h, DCTELEM * block, int n){
if (code == rl->n) {
put_bits(&s->pb, 6, run);
assert(slevel != 0);
- if(slevel < -127){
- slevel = -127;
- }
- else if(slevel > 127){
- slevel = 127;
- }
+ assert(level <= 127);
put_bits(&s->pb, 8, slevel & 0xff);
} else {
put_bits(&s->pb, 1, sign);
@@ -742,7 +736,7 @@ static int h261_decode_block(H261Context * h, DCTELEM * block,
/* escape */
// The remaining combinations of (run, level) are encoded with a 20-bit word consisting of 6 bits escape, 6 bits run and 8 bits level.
run = get_bits(&s->gb, 6);
- level = (int8_t)get_bits(&s->gb, 8);
+ level = get_sbits(&s->gb, 8);
}else if(code == 0){
break;
}else{