Mercurial > libavcodec.hg
comparison mpeg12.c @ 911:4b2c86f1fee9 libavcodec
drop b frames if there are no reference frames
skip b frames if hurry_up
author | michaelni |
---|---|
date | Thu, 05 Dec 2002 11:33:43 +0000 |
parents | 22ee74da2cd3 |
children | d3aa313dc373 |
comparison
equal
deleted
inserted
replaced
910:eb448df811be | 911:4b2c86f1fee9 |
---|---|
1419 s->mpeg_f_code[1][0] = f_code; | 1419 s->mpeg_f_code[1][0] = f_code; |
1420 s->mpeg_f_code[1][1] = f_code; | 1420 s->mpeg_f_code[1][1] = f_code; |
1421 } | 1421 } |
1422 s->current_picture.pict_type= s->pict_type; | 1422 s->current_picture.pict_type= s->pict_type; |
1423 s->current_picture.key_frame= s->pict_type == I_TYPE; | 1423 s->current_picture.key_frame= s->pict_type == I_TYPE; |
1424 | |
1424 s->y_dc_scale = 8; | 1425 s->y_dc_scale = 8; |
1425 s->c_dc_scale = 8; | 1426 s->c_dc_scale = 8; |
1426 s->first_slice = 1; | 1427 s->first_slice = 1; |
1427 return 0; | 1428 return 0; |
1428 } | 1429 } |
1893 case EXT_START_CODE: | 1894 case EXT_START_CODE: |
1894 mpeg_decode_extension(avctx, | 1895 mpeg_decode_extension(avctx, |
1895 s->buffer, input_size); | 1896 s->buffer, input_size); |
1896 break; | 1897 break; |
1897 default: | 1898 default: |
1899 /* skip b frames if we dont have reference frames */ | |
1900 if(s2->last_picture.data[0]==NULL && s2->pict_type==B_TYPE) break; | |
1901 /* skip b frames if we are in a hurry */ | |
1902 if(avctx->hurry_up && s2->pict_type==B_TYPE) break; | |
1903 /* skip everything if we are in a hurry>=5 */ | |
1904 if(avctx->hurry_up>=5) break; | |
1905 | |
1898 if (start_code >= SLICE_MIN_START_CODE && | 1906 if (start_code >= SLICE_MIN_START_CODE && |
1899 start_code <= SLICE_MAX_START_CODE && avctx->hurry_up<5) { | 1907 start_code <= SLICE_MAX_START_CODE) { |
1900 ret = mpeg_decode_slice(avctx, picture, | 1908 ret = mpeg_decode_slice(avctx, picture, |
1901 start_code, s->buffer, input_size); | 1909 start_code, s->buffer, input_size); |
1902 if (ret == DECODE_SLICE_EOP) { | 1910 if (ret == DECODE_SLICE_EOP) { |
1903 /* got a picture: exit */ | 1911 /* got a picture: exit */ |
1904 /* first check if we must repeat the frame */ | 1912 /* first check if we must repeat the frame */ |