From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 2/7] avcodec/proresdsp: Pass necessary parameter directly
Date: Fri, 8 Sep 2023 16:07:22 +0200
Message-ID: <AS8P250MB0744DB9942CD09DF891B9A518FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB074429EE169A8357C6FC520C8FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
Only avctx->bits_per_raw_sample is used.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-09-08 14:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 14:02 [FFmpeg-devel] [PATCH 1/7] avcodec/proresdec: Include required headers directly Andreas Rheinhardt
2023-09-08 14:07 ` Andreas Rheinhardt [this message]
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 3/7] avcodec/idctdsp: Avoid inclusion of avcodec.h Andreas Rheinhardt
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 4/7] avcodec/vlc: Add documentation for ff_init_vlc_sparse() Andreas Rheinhardt
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 5/7] tools/patcheck: Remove test for ancient INIT_VLC_USE_STATIC Andreas Rheinhardt
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 6/7] avcodec/vlc: Use proper namespace Andreas Rheinhardt
2023-09-09 23:40 ` Michael Niedermayer
2023-09-08 14:07 ` [FFmpeg-devel] [PATCH 7/7] avcodec/truemotion2: Don't check before freeing VLC Andreas Rheinhardt
2023-09-08 18:11 ` Paul B Mahol
2023-09-10 8:50 ` [FFmpeg-devel] [PATCH 1/7] avcodec/proresdec: Include required headers directly Andreas Rheinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB0744DB9942CD09DF891B9A518FEDA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git