]> git.sesse.net Git - ffmpeg/commitdiff
h264: simplify calls to ff_er_add_slice().
authorAnton Khirnov <anton@khirnov.net>
Sat, 2 Feb 2013 14:18:00 +0000 (15:18 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 15 Feb 2013 15:09:37 +0000 (16:09 +0100)
partitioned_frame is never set for h264 (as easily seen from git grep).

libavcodec/h264.c

index 542070be938436f505216528c72e9777fe3293e2..ec6c656333fba3d5c5ddb4ab8d03045e1b1b3bba 100644 (file)
@@ -3645,8 +3645,6 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
 {
     H264Context *h = *(void **)arg;
     MpegEncContext *const s = &h->s;
-    const int part_mask     = s->partitioned_frame ? (ER_AC_END | ER_AC_ERROR)
-                                                   : 0x7F;
     int lf_x_start = s->mb_x;
 
     s->mb_skip_run = -1;
@@ -3691,7 +3689,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
             if ((s->workaround_bugs & FF_BUG_TRUNCATED) &&
                 h->cabac.bytestream > h->cabac.bytestream_end + 2) {
                 ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x - 1,
-                                s->mb_y, ER_MB_END & part_mask);
+                                s->mb_y, ER_MB_END);
                 if (s->mb_x >= lf_x_start)
                     loop_filter(h, lf_x_start, s->mb_x + 1);
                 return 0;
@@ -3702,7 +3700,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
                        s->mb_x, s->mb_y,
                        h->cabac.bytestream_end - h->cabac.bytestream);
                 ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x,
-                                s->mb_y, ER_MB_ERROR & part_mask);
+                                s->mb_y, ER_MB_ERROR);
                 return -1;
             }
 
@@ -3722,7 +3720,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
                 tprintf(s->avctx, "slice end %d %d\n",
                         get_bits_count(&s->gb), s->gb.size_in_bits);
                 ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x - 1,
-                                s->mb_y, ER_MB_END & part_mask);
+                                s->mb_y, ER_MB_END);
                 if (s->mb_x > lf_x_start)
                     loop_filter(h, lf_x_start, s->mb_x);
                 return 0;
@@ -3749,7 +3747,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
                 av_log(h->s.avctx, AV_LOG_ERROR,
                        "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
                 ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x,
-                                s->mb_y, ER_MB_ERROR & part_mask);
+                                s->mb_y, ER_MB_ERROR);
                 return -1;
             }
 
@@ -3770,13 +3768,13 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
                     if (get_bits_left(&s->gb) == 0) {
                         ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y,
                                         s->mb_x - 1, s->mb_y,
-                                        ER_MB_END & part_mask);
+                                        ER_MB_END);
 
                         return 0;
                     } else {
                         ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y,
                                         s->mb_x - 1, s->mb_y,
-                                        ER_MB_END & part_mask);
+                                        ER_MB_END);
 
                         return -1;
                     }
@@ -3789,14 +3787,14 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
                 if (get_bits_left(&s->gb) == 0) {
                     ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y,
                                     s->mb_x - 1, s->mb_y,
-                                    ER_MB_END & part_mask);
+                                    ER_MB_END);
                     if (s->mb_x > lf_x_start)
                         loop_filter(h, lf_x_start, s->mb_x);
 
                     return 0;
                 } else {
                     ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x,
-                                    s->mb_y, ER_MB_ERROR & part_mask);
+                                    s->mb_y, ER_MB_ERROR);
 
                     return -1;
                 }