Commit 7b0b9a25 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avcodec/proresdsp: Pass necessary parameter directly

Only avctx->bits_per_raw_sample is used.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent 489d96ca
...@@ -172,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -172,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
} }
ff_blockdsp_init(&ctx->bdsp); ff_blockdsp_init(&ctx->bdsp);
ret = ff_proresdsp_init(&ctx->prodsp, avctx); ret = ff_proresdsp_init(&ctx->prodsp, avctx->bits_per_raw_sample);
if (ret < 0) { if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Fail to init proresdsp for bits per raw sample %d\n", avctx->bits_per_raw_sample); av_log(avctx, AV_LOG_ERROR, "Fail to init proresdsp for bits per raw sample %d\n", avctx->bits_per_raw_sample);
return ret; return ret;
......
...@@ -76,12 +76,12 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo ...@@ -76,12 +76,12 @@ static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *blo
put_pixels_12(out, linesize >> 1, block); put_pixels_12(out, linesize >> 1, block);
} }
av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) av_cold int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample)
{ {
if (avctx->bits_per_raw_sample == 10) { if (bits_per_raw_sample == 10) {
dsp->idct_put = prores_idct_put_10_c; dsp->idct_put = prores_idct_put_10_c;
dsp->idct_permutation_type = FF_IDCT_PERM_NONE; dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
} else if (avctx->bits_per_raw_sample == 12) { } else if (bits_per_raw_sample == 12) {
dsp->idct_put = prores_idct_put_12_c; dsp->idct_put = prores_idct_put_12_c;
dsp->idct_permutation_type = FF_IDCT_PERM_NONE; dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
} else { } else {
...@@ -89,7 +89,7 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) ...@@ -89,7 +89,7 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
} }
#if ARCH_X86 #if ARCH_X86
ff_proresdsp_init_x86(dsp, avctx); ff_proresdsp_init_x86(dsp, bits_per_raw_sample);
#endif #endif
ff_init_scantable_permutation(dsp->idct_permutation, ff_init_scantable_permutation(dsp->idct_permutation,
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "avcodec.h"
typedef struct ProresDSPContext { typedef struct ProresDSPContext {
int idct_permutation_type; int idct_permutation_type;
...@@ -33,8 +32,8 @@ typedef struct ProresDSPContext { ...@@ -33,8 +32,8 @@ typedef struct ProresDSPContext {
void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
} ProresDSPContext; } ProresDSPContext;
int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample);
void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx); void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample);
#endif /* AVCODEC_PRORESDSP_H */ #endif /* AVCODEC_PRORESDSP_H */
...@@ -30,12 +30,12 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, ptrdiff_t linesize, ...@@ -30,12 +30,12 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, ptrdiff_t linesize,
void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize, void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize,
int16_t *block, const int16_t *qmat); int16_t *block, const int16_t *qmat);
av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample)
{ {
#if ARCH_X86_64 #if ARCH_X86_64
int cpu_flags = av_get_cpu_flags(); int cpu_flags = av_get_cpu_flags();
if (avctx->bits_per_raw_sample == 10){ if (bits_per_raw_sample == 10) {
if (EXTERNAL_SSE2(cpu_flags)) { if (EXTERNAL_SSE2(cpu_flags)) {
dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE;
dsp->idct_put = ff_prores_idct_put_10_sse2; dsp->idct_put = ff_prores_idct_put_10_sse2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment