]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264_picture.c
lavc: add libdcadec decoder
[ffmpeg] / libavcodec / h264_picture.c
index d7e6ce5e8d26dc2b68e46fa7ad149db74bcb06a8..5792f77c7cdc16a98191cc0ff4a3a69c3669323c 100644 (file)
@@ -31,7 +31,6 @@
 #include "internal.h"
 #include "cabac.h"
 #include "cabac_functions.h"
-#include "dsputil.h"
 #include "error_resilience.h"
 #include "avcodec.h"
 #include "h264.h"
@@ -145,7 +144,7 @@ static void h264_set_erpic(ERPicture *dst, H264Picture *src)
 }
 #endif /* CONFIG_ERROR_RESILIENCE */
 
-int ff_h264_field_end(H264Context *h, int in_setup)
+int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
 {
     AVCodecContext *const avctx = h->avctx;
     int err = 0;
@@ -172,6 +171,7 @@ int ff_h264_field_end(H264Context *h, int in_setup)
                    "hardware accelerator failed to decode picture\n");
     }
 
+#if CONFIG_ERROR_RESILIENCE
     /*
      * FIXME: Error handling code does not seem to support interlaced
      * when slices span multiple rows
@@ -184,14 +184,16 @@ int ff_h264_field_end(H264Context *h, int in_setup)
      * past end by one (callers fault) and resync_mb_y != 0
      * causes problems for the first MB line, too.
      */
-    if (CONFIG_ERROR_RESILIENCE && !FIELD_PICTURE(h)) {
-        h264_set_erpic(&h->er.cur_pic, h->cur_pic_ptr);
-        h264_set_erpic(&h->er.last_pic,
-                       h->ref_count[0] ? &h->ref_list[0][0] : NULL);
-        h264_set_erpic(&h->er.next_pic,
-                       h->ref_count[1] ? &h->ref_list[1][0] : NULL);
-        ff_er_frame_end(&h->er);
+    if (!FIELD_PICTURE(h)) {
+        h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
+        h264_set_erpic(&sl->er.last_pic,
+                       sl->ref_count[0] ? sl->ref_list[0][0].parent : NULL);
+        h264_set_erpic(&sl->er.next_pic,
+                       sl->ref_count[1] ? sl->ref_list[1][0].parent : NULL);
+        ff_er_frame_end(&sl->er);
     }
+#endif /* CONFIG_ERROR_RESILIENCE */
+
     emms_c();
 
     h->current_slice = 0;