mb stuffing in partitioned frames fix
Originally committed as revision 2869 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
b056e73c80
commit
b98202a438
@ -3336,11 +3336,11 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
|
|||||||
if(s->pict_type==I_TYPE){
|
if(s->pict_type==I_TYPE){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
do{
|
||||||
if(show_bits_long(&s->gb, 19)==DC_MARKER){
|
if(show_bits_long(&s->gb, 19)==DC_MARKER){
|
||||||
return mb_num-1;
|
return mb_num-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
do{
|
|
||||||
cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
|
cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
|
||||||
if (cbpc < 0){
|
if (cbpc < 0){
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
|
av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
|
||||||
@ -3374,7 +3374,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
|
|||||||
int16_t * const mot_val= s->current_picture.motion_val[0][s->block_index[0]];
|
int16_t * const mot_val= s->current_picture.motion_val[0][s->block_index[0]];
|
||||||
const int stride= s->block_wrap[0]*2;
|
const int stride= s->block_wrap[0]*2;
|
||||||
|
|
||||||
// do{ //FIXME
|
try_again:
|
||||||
bits= show_bits(&s->gb, 17);
|
bits= show_bits(&s->gb, 17);
|
||||||
if(bits==MOTION_MARKER){
|
if(bits==MOTION_MARKER){
|
||||||
return mb_num-1;
|
return mb_num-1;
|
||||||
@ -3405,7 +3405,8 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
|
|||||||
av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
|
av_log(s->avctx, AV_LOG_ERROR, "cbpc corrupted at %d %d\n", s->mb_x, s->mb_y);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// }while(cbpc == 20);
|
if(cbpc == 20)
|
||||||
|
goto try_again;
|
||||||
|
|
||||||
s->cbp_table[xy]= cbpc&(8+3); //8 is dquant
|
s->cbp_table[xy]= cbpc&(8+3); //8 is dquant
|
||||||
|
|
||||||
@ -3586,11 +3587,15 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s)
|
|||||||
s->mb_num_left= mb_num;
|
s->mb_num_left= mb_num;
|
||||||
|
|
||||||
if(s->pict_type==I_TYPE){
|
if(s->pict_type==I_TYPE){
|
||||||
|
while(show_bits(&s->gb, 9) == 1)
|
||||||
|
skip_bits(&s->gb, 9);
|
||||||
if(get_bits_long(&s->gb, 19)!=DC_MARKER){
|
if(get_bits_long(&s->gb, 19)!=DC_MARKER){
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "marker missing after first I partition at %d %d\n", s->mb_x, s->mb_y);
|
av_log(s->avctx, AV_LOG_ERROR, "marker missing after first I partition at %d %d\n", s->mb_x, s->mb_y);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
while(show_bits(&s->gb, 10) == 1)
|
||||||
|
skip_bits(&s->gb, 10);
|
||||||
if(get_bits(&s->gb, 17)!=MOTION_MARKER){
|
if(get_bits(&s->gb, 17)!=MOTION_MARKER){
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "marker missing after first P partition at %d %d\n", s->mb_x, s->mb_y);
|
av_log(s->avctx, AV_LOG_ERROR, "marker missing after first P partition at %d %d\n", s->mb_x, s->mb_y);
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user