On Thu, Feb 27, 2014 at 02:49:53PM -0800, Diego Biurrun wrote:
> It never has different values, so just use the right value directly.
> ---
>  libavcodec/proresdsp.c | 4 +---
>  libavcodec/proresdsp.h | 1 -
>  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
> index ac05d61..05d312c 100644
> --- a/libavcodec/proresdsp.c
> +++ b/libavcodec/proresdsp.c
> @@ -86,8 +86,6 @@ av_cold void ff_proresdsp_init(ProresDSPContext *dsp)
>  #endif
>  #if CONFIG_PRORES_ENCODER
>      dsp->fdct                 = prores_fdct_c;
> -    dsp->dct_permutation_type = FF_NO_IDCT_PERM;
> -    ff_init_scantable_permutation(dsp->dct_permutation,
> -                                  dsp->dct_permutation_type);
> +    ff_init_scantable_permutation(dsp->dct_permutation, FF_NO_IDCT_PERM);
>  #endif
>  }
> diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h
> index 21d12e8..732d30a 100644
> --- a/libavcodec/proresdsp.h
> +++ b/libavcodec/proresdsp.h
> @@ -30,7 +30,6 @@
>  typedef struct ProresDSPContext {
>      int idct_permutation_type;
>      uint8_t idct_permutation[64];
> -    int dct_permutation_type;
>      uint8_t dct_permutation[64];
>      void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const 
> int16_t *qmat);
>      void (* fdct) (const uint16_t *src, int linesize, int16_t *block);
> -- 

Not enough, the proper way is to get rid of scantable in encoder entirely,
like (not tested though):

--- a/libavcodec/proresenc.c
+++ b/libavcodec/proresenc.c
@@ -192,7 +192,7 @@ typedef struct ProresContext {
     const uint8_t *quant_mat;
 
     ProresDSPContext dsp;
-    ScanTable  scantable;
+    const uint8_t *scantable;
 
     int mb_width, mb_height;
     int mbs_per_slice;
@@ -426,7 +426,7 @@ static int encode_slice_plane(ProresContext *ctx,
PutBitCont
 
     encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);
     encode_acs(pb, blocks, blocks_per_slice, plane_size_factor,
-               ctx->scantable.permutated, qmat);
+               ctx->scantable, qmat);
     flush_put_bits(pb);
 
     return (put_bits_count(pb) - saved_pos) >> 3;
@@ -673,7 +673,7 @@ static int estimate_slice_plane(ProresContext *ctx, int
*err
 
     bits  = estimate_dcs(error, td->blocks[plane], blocks_per_slice,
qmat[0]);
     bits += estimate_acs(error, td->blocks[plane], blocks_per_slice,
-                         plane_size_factor, ctx->scantable.permutated, qmat);
+                         plane_size_factor, ctx->scantable, qmat);
 
     return FFALIGN(bits, 8);
 }
@@ -1080,9 +1080,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
         return AVERROR(ENOMEM);
 
     ff_proresdsp_init(&ctx->dsp);
-    ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable,
-                      interlaced ? ff_prores_interlaced_scan
-                                 : ff_prores_progressive_scan);
+    scantable = interlaced ? ff_prores_interlaced_scan
+                           : ff_prores_progressive_scan;
 
     mps = ctx->mbs_per_slice;
     if (mps & (mps - 1)) {

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to