comparison mpeg12enc.c @ 9457:6fe0b0ff991a libavcodec

Move declarations in mpeg1_encode_motion() closer to where they are needed.
author michael
date Fri, 17 Apr 2009 12:53:11 +0000
parents 9e02b59f53ed
children 38cfe222e1a4
comparison
equal deleted inserted replaced
9456:9e02b59f53ed 9457:6fe0b0ff991a
664 } 664 }
665 665
666 // RAL: Parameter added: f_or_b_code 666 // RAL: Parameter added: f_or_b_code
667 static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code) 667 static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code)
668 { 668 {
669 int code, bit_size, l, bits, range, sign;
670
671 if (val == 0) { 669 if (val == 0) {
672 /* zero vector */ 670 /* zero vector */
673 put_bits(&s->pb, 671 put_bits(&s->pb,
674 ff_mpeg12_mbMotionVectorTable[0][1], 672 ff_mpeg12_mbMotionVectorTable[0][1],
675 ff_mpeg12_mbMotionVectorTable[0][0]); 673 ff_mpeg12_mbMotionVectorTable[0][0]);
676 } else { 674 } else {
677 bit_size = f_or_b_code - 1; 675 int code, sign, bits;
678 range = 1 << bit_size; 676 int bit_size = f_or_b_code - 1;
677 int range = 1 << bit_size;
679 /* modulo encoding */ 678 /* modulo encoding */
680 l= INT_BIT - 5 - bit_size; 679 int l= INT_BIT - 5 - bit_size;
681 val= (val<<l)>>l; 680 val= (val<<l)>>l;
682 681
683 if (val >= 0) { 682 if (val >= 0) {
684 val--; 683 val--;
685 code = (val >> bit_size) + 1; 684 code = (val >> bit_size) + 1;