[FFmpeg-cvslog] avcodec/proresdsp: Pass necessary parameter directly
Andreas Rheinhardt
git at videolan.org
Mon Sep 11 02:02:23 EEST 2023
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Sep 8 12:49:28 2023 +0200| [7b0b9a25ed11625ae75f1fa47db41744578675fe] | committer: Andreas Rheinhardt
avcodec/proresdsp: Pass necessary parameter directly
Only avctx->bits_per_raw_sample is used.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b0b9a25ed11625ae75f1fa47db41744578675fe
---
libavcodec/proresdec2.c | 2 +-
libavcodec/proresdsp.c | 8 ++++----
libavcodec/proresdsp.h | 5 ++---
libavcodec/x86/proresdsp_init.c | 4 ++--
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 9297860946..2219971b85 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -172,7 +172,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
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) {
av_log(avctx, AV_LOG_ERROR, "Fail to init proresdsp for bits per raw sample %d\n", avctx->bits_per_raw_sample);
return ret;
diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index 6ed01179fe..bc253e55f7 100644
--- a/libavcodec/proresdsp.c
+++ b/libavcodec/proresdsp.c
@@ -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);
}
-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_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_permutation_type = FF_IDCT_PERM_NONE;
} else {
@@ -89,7 +89,7 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
}
#if ARCH_X86
- ff_proresdsp_init_x86(dsp, avctx);
+ ff_proresdsp_init_x86(dsp, bits_per_raw_sample);
#endif
ff_init_scantable_permutation(dsp->idct_permutation,
diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h
index 37ba76b8e4..966ba3d797 100644
--- a/libavcodec/proresdsp.h
+++ b/libavcodec/proresdsp.h
@@ -25,7 +25,6 @@
#include <stddef.h>
#include <stdint.h>
-#include "avcodec.h"
typedef struct ProresDSPContext {
int idct_permutation_type;
@@ -33,8 +32,8 @@ typedef struct ProresDSPContext {
void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat);
} 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 */
diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c
index bde79ab8c0..f7abbfa692 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -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,
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
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)) {
dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE;
dsp->idct_put = ff_prores_idct_put_10_sse2;
More information about the ffmpeg-cvslog
mailing list