[FFmpeg-cvslog] avcodec/proresdec2: remove duplicated function

Paul B Mahol git at videolan.org
Wed Jun 14 13:05:38 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jun 14 11:59:58 2023 +0200| [cfcd6e2108a7c43394840ca857ba1b6e8f6351c2] | committer: Paul B Mahol

avcodec/proresdec2: remove duplicated function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cfcd6e2108a7c43394840ca857ba1b6e8f6351c2
---

 libavcodec/proresdec2.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 6445d948d9..b86614adc0 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -44,13 +44,6 @@
 #include "proresdata.h"
 #include "thread.h"
 
-static void permute(uint8_t *dst, const uint8_t *src, const uint8_t permutation[64])
-{
-    int i;
-    for (i = 0; i < 64; i++)
-        dst[i] = permutation[src[i]];
-}
-
 #define ALPHA_SHIFT_16_TO_10(alpha_val) (alpha_val >> 6)
 #define ALPHA_SHIFT_8_TO_10(alpha_val)  ((alpha_val << 2) | (alpha_val >> 6))
 #define ALPHA_SHIFT_16_TO_12(alpha_val) (alpha_val >> 4)
@@ -187,8 +180,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     ff_init_scantable_permutation(idct_permutation,
                                   ctx->prodsp.idct_permutation_type);
 
-    permute(ctx->progressive_scan, ff_prores_progressive_scan, idct_permutation);
-    permute(ctx->interlaced_scan, ff_prores_interlaced_scan, idct_permutation);
+    ff_permute_scantable(ctx->progressive_scan, ff_prores_progressive_scan, idct_permutation);
+    ff_permute_scantable(ctx->interlaced_scan, ff_prores_interlaced_scan, idct_permutation);
 
     ctx->pix_fmt = AV_PIX_FMT_NONE;
 
@@ -304,7 +297,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
             av_log(avctx, AV_LOG_ERROR, "Header truncated\n");
             return AVERROR_INVALIDDATA;
         }
-        permute(ctx->qmat_luma, ctx->prodsp.idct_permutation, ptr);
+        ff_permute_scantable(ctx->qmat_luma, ctx->prodsp.idct_permutation, ptr);
         ptr += 64;
     } else {
         memset(ctx->qmat_luma, 4, 64);
@@ -315,7 +308,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
             av_log(avctx, AV_LOG_ERROR, "Header truncated\n");
             return AVERROR_INVALIDDATA;
         }
-        permute(ctx->qmat_chroma, ctx->prodsp.idct_permutation, ptr);
+        ff_permute_scantable(ctx->qmat_chroma, ctx->prodsp.idct_permutation, ptr);
     } else {
         memcpy(ctx->qmat_chroma, ctx->qmat_luma, 64);
     }



More information about the ffmpeg-cvslog mailing list