]> git.sesse.net Git - ffmpeg/commitdiff
svq3: eliminate write_back_intra_pred_mode() usage
authorAnton Khirnov <anton@khirnov.net>
Tue, 22 Mar 2016 14:52:45 +0000 (15:52 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 28 Mar 2016 07:51:10 +0000 (09:51 +0200)
This function depends on the h264 internals and is so tiny that just
copying the code out is the simplest replacement.

libavcodec/svq3.c

index 9d99da5517bc8f475dab3b0a136b7f7d8a471d4f..f3582f6cad3c862a5aad0d7950a5407a0730ead2 100644 (file)
@@ -714,6 +714,9 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
 
         mb_type = MB_TYPE_16x16;
     } else if (mb_type == 8 || mb_type == 33) {   /* INTRA4x4 */
+        int8_t *i4x4       = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy];
+        int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache;
+
         memset(sl->intra4x4_pred_mode_cache, -1, 8 * 5 * sizeof(int8_t));
 
         if (mb_type == 8) {
@@ -759,7 +762,10 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
                 memset(&sl->intra4x4_pred_mode_cache[scan8[0] + 8 * i], DC_PRED, 4);
         }
 
-        write_back_intra_pred_mode(h, sl);
+        AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4);
+        i4x4[4] = i4x4_cache[7 + 8 * 3];
+        i4x4[5] = i4x4_cache[7 + 8 * 2];
+        i4x4[6] = i4x4_cache[7 + 8 * 1];
 
         if (mb_type == 8) {
             ff_h264_check_intra4x4_pred_mode(h, sl);