aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-08-01 22:39:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-08-01 22:39:03 +0000
commit2f446d3860618c5bf5585965f65e6301c957313a (patch)
tree81042c937c9176e6f8dc7bce1aba1cac6b7a8900
parent653f738780035025ee4360757c5ad071ee82bedb (diff)
downloadffmpeg-2f446d3860618c5bf5585965f65e6301c957313a.tar.gz
get rid of mb_type_len
Originally committed as revision 9865 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mpeg12enc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index a0be12ff0f..aac90e04ec 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -562,21 +562,19 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
}
s->f_count++;
} else{
- static const int mb_type_len[4]={0,4,3,2}; //bak,for,bi
-
if(s->mv_type == MV_TYPE_16X16){
if (cbp){ // With coded bloc pattern
if (s->dquant) {
if(s->mv_dir == MV_DIR_FORWARD)
put_mb_modes(s, 6, 3, 1, 0);
else
- put_mb_modes(s, mb_type_len[s->mv_dir]+3, 2, 1, 0);
+ put_mb_modes(s, 8-s->mv_dir, 2, 1, 0);
put_qscale(s);
} else {
- put_mb_modes(s, mb_type_len[s->mv_dir], 3, 1, 0);
+ put_mb_modes(s, 5-s->mv_dir, 3, 1, 0);
}
}else{ // No coded bloc pattern
- put_bits(&s->pb, mb_type_len[s->mv_dir], 2);
+ put_bits(&s->pb, 5-s->mv_dir, 2);
if (!s->frame_pred_frame_dct)
put_bits(&s->pb, 2, 2); /* motion_type: frame */
s->qscale -= s->dquant;
@@ -604,13 +602,13 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
if(s->mv_dir == MV_DIR_FORWARD)
put_mb_modes(s, 6, 3, 1, 1);
else
- put_mb_modes(s, mb_type_len[s->mv_dir]+3, 2, 1, 1);
+ put_mb_modes(s, 8-s->mv_dir, 2, 1, 1);
put_qscale(s);
} else {
- put_mb_modes(s, mb_type_len[s->mv_dir], 3, 1, 1);
+ put_mb_modes(s, 5-s->mv_dir, 3, 1, 1);
}
}else{ // No coded bloc pattern
- put_bits(&s->pb, mb_type_len[s->mv_dir], 2);
+ put_bits(&s->pb, 5-s->mv_dir, 2);
put_bits(&s->pb, 2, 1); /* motion_type: field */
s->qscale -= s->dquant;
}