summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/mpeg12.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg/libavcodec/mpeg12.c')
-rw-r--r--src/libffmpeg/libavcodec/mpeg12.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libffmpeg/libavcodec/mpeg12.c b/src/libffmpeg/libavcodec/mpeg12.c
index 10abf1024..fecb097bd 100644
--- a/src/libffmpeg/libavcodec/mpeg12.c
+++ b/src/libffmpeg/libavcodec/mpeg12.c
@@ -504,7 +504,7 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val)
void ff_mpeg1_encode_init(MpegEncContext *s)
{
-#ifdef CONFIG_ENCODERS
+#if 0
static int done=0;
common_init(s);
@@ -769,6 +769,8 @@ static int mpeg_decode_mb(MpegEncContext *s,
dprintf("decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
+ assert(s->mb_skiped==0);
+
if (--s->mb_incr != 0) {
/* skip mb */
s->mb_intra = 0;
@@ -781,15 +783,18 @@ static int mpeg_decode_mb(MpegEncContext *s,
s->mv[0][0][0] = s->mv[0][0][1] = 0;
s->last_mv[0][0][0] = s->last_mv[0][0][1] = 0;
s->last_mv[0][1][0] = s->last_mv[0][1][1] = 0;
+ s->mb_skiped = 1;
} else {
/* if B type, reuse previous vectors and directions */
s->mv[0][0][0] = s->last_mv[0][0][0];
s->mv[0][0][1] = s->last_mv[0][0][1];
s->mv[1][0][0] = s->last_mv[1][0][0];
s->mv[1][0][1] = s->last_mv[1][0][1];
+
+ if((s->mv[0][0][0]|s->mv[0][0][1]|s->mv[1][0][0]|s->mv[1][0][1])==0)
+ s->mb_skiped = 1;
}
- s->mb_skiped = 1;
return 0;
}
@@ -1464,7 +1469,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ref, f_code;
- init_get_bits(&s->gb, buf, buf_size);
+ init_get_bits(&s->gb, buf, buf_size*8);
ref = get_bits(&s->gb, 10); /* temporal ref */
s->pict_type = get_bits(&s->gb, 3);
@@ -1616,7 +1621,7 @@ static void mpeg_decode_extension(AVCodecContext *avctx,
MpegEncContext *s = &s1->mpeg_enc_ctx;
int ext_type;
- init_get_bits(&s->gb, buf, buf_size);
+ init_get_bits(&s->gb, buf, buf_size*8);
ext_type = get_bits(&s->gb, 4);
switch(ext_type) {
@@ -1672,7 +1677,7 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
return DECODE_SLICE_FATAL_ERROR;
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- printf("qp:%d fc:%d%d%d%d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
+ printf("qp:%d fc:%2d%2d%2d%2d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1],
s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")),
s->progressive_sequence ? "pro" :"", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
@@ -1681,7 +1686,7 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
}
}
- init_get_bits(&s->gb, buf, buf_size);
+ init_get_bits(&s->gb, buf, buf_size*8);
s->qscale = get_qscale(s);
/* extra slice info */
@@ -1790,7 +1795,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
int width, height, i, v, j;
float aspect;
- init_get_bits(&s->gb, buf, buf_size);
+ init_get_bits(&s->gb, buf, buf_size*8);
width = get_bits(&s->gb, 12);
height = get_bits(&s->gb, 12);