aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-25 00:13:02 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-25 00:13:02 +0000
commit9296f5d81acb9b3f8d8870a78ded6e284a1f4f58 (patch)
tree8362e7cb6dec3f1f800c7d768efb49001040a858 /libavcodec/h264.c
parent357282c6f3c990833d0508c234ac4522d536c4ac (diff)
downloadffmpeg-9296f5d81acb9b3f8d8870a78ded6e284a1f4f58.tar.gz
Simplify strange obfuscated code in MMCO_LONG handling.
Note, this might change behavior for invalid bitstreams. Originally committed as revision 14381 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a52ea66f33..cfa63d62aa 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3454,7 +3454,7 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
av_log(h->s.avctx, AV_LOG_DEBUG, "no mmco here\n");
for(i=0; i<mmco_count; i++){
- int structure, frame_num, unref_pic;
+ int structure, frame_num;
if(s->avctx->debug&FF_DEBUG_MMCO)
av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_pic_num, h->mmco[i].long_arg);
@@ -3498,27 +3498,15 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref long failure\n");
break;
case MMCO_LONG:
- unref_pic = 1;
- if (FIELD_PICTURE && !s->first_field) {
- if (h->long_ref[mmco[i].long_arg] == s->current_picture_ptr) {
- /* Just mark second field as referenced */
- unref_pic = 0;
- } else if (s->current_picture_ptr->reference) {
+ // Comment below left from previous code as it is an interresting note.
/* First field in pair is in short term list or
* at a different long term index.
* This is not allowed; see 7.4.3, notes 2 and 3.
* Report the problem and keep the pair where it is,
* and mark this field valid.
*/
- av_log(h->s.avctx, AV_LOG_ERROR,
- "illegal long term reference assignment for second "
- "field in complementary field pair (first field is "
- "short term or has non-matching long index)\n");
- unref_pic = 0;
- }
- }
- if (unref_pic) {
+ if (h->long_ref[mmco[i].long_arg] != s->current_picture_ptr) {
pic= remove_long(h, mmco[i].long_arg);
if(pic) unreference_pic(h, pic, 0);