From: IndecisiveTurtle <geoster3d@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: IndecisiveTurtle <geoster3d@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 3/5] libavcodec/vc2enc: Pass quant array as argument to init function Date: Fri, 18 Apr 2025 02:55:30 +0300 Message-ID: <20250417235543.227108-3-47210458+raphaelthegreat@users.noreply.github.com> (raw) In-Reply-To: <20250417235543.227108-1-47210458+raphaelthegreat@users.noreply.github.com> From: IndecisiveTurtle <geoster3d@gmail.com> --- libavcodec/vc2enc.c | 2 +- libavcodec/vc2enc_common.c | 18 +++++++++--------- libavcodec/vc2enc_common.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c index 2e849eb09e..c0f542e116 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -160,7 +160,7 @@ static int calc_slice_sizes(VC2EncContext *s) SliceArgs *enc_args = s->slice_args; SliceArgs *top_loc[SLICE_REDIST_TOTAL] = {NULL}; - vc2_init_quant_matrix(s); + vc2_init_quant_matrix(s, s->quant); for (slice_y = 0; slice_y < s->num_y; slice_y++) { for (slice_x = 0; slice_x < s->num_x; slice_x++) { diff --git a/libavcodec/vc2enc_common.c b/libavcodec/vc2enc_common.c index 7452e9fd8a..fdcb04d8dd 100644 --- a/libavcodec/vc2enc_common.c +++ b/libavcodec/vc2enc_common.c @@ -293,17 +293,17 @@ static const uint8_t vc2_qm_flat_tab[][4] = { { 0, 0, 0, 0} }; -void vc2_init_quant_matrix(VC2EncContext *s) +void vc2_init_quant_matrix(VC2EncContext *s, int quant[MAX_DWT_LEVELS][4]) { int level, orientation; if (s->wavelet_depth <= 4 && s->quant_matrix == VC2_QM_DEF) { s->custom_quant_matrix = 0; for (level = 0; level < s->wavelet_depth; level++) { - s->quant[level][0] = ff_dirac_default_qmat[s->wavelet_idx][level][0]; - s->quant[level][1] = ff_dirac_default_qmat[s->wavelet_idx][level][1]; - s->quant[level][2] = ff_dirac_default_qmat[s->wavelet_idx][level][2]; - s->quant[level][3] = ff_dirac_default_qmat[s->wavelet_idx][level][3]; + quant[level][0] = ff_dirac_default_qmat[s->wavelet_idx][level][0]; + quant[level][1] = ff_dirac_default_qmat[s->wavelet_idx][level][1]; + quant[level][2] = ff_dirac_default_qmat[s->wavelet_idx][level][2]; + quant[level][3] = ff_dirac_default_qmat[s->wavelet_idx][level][3]; } return; } @@ -314,21 +314,21 @@ void vc2_init_quant_matrix(VC2EncContext *s) for (level = 0; level < s->wavelet_depth; level++) { for (orientation = 0; orientation < 4; orientation++) { if (level <= 3) - s->quant[level][orientation] = ff_dirac_default_qmat[s->wavelet_idx][level][orientation]; + quant[level][orientation] = ff_dirac_default_qmat[s->wavelet_idx][level][orientation]; else - s->quant[level][orientation] = vc2_qm_col_tab[level][orientation]; + quant[level][orientation] = vc2_qm_col_tab[level][orientation]; } } } else if (s->quant_matrix == VC2_QM_COL) { for (level = 0; level < s->wavelet_depth; level++) { for (orientation = 0; orientation < 4; orientation++) { - s->quant[level][orientation] = vc2_qm_col_tab[level][orientation]; + quant[level][orientation] = vc2_qm_col_tab[level][orientation]; } } } else { for (level = 0; level < s->wavelet_depth; level++) { for (orientation = 0; orientation < 4; orientation++) { - s->quant[level][orientation] = vc2_qm_flat_tab[level][orientation]; + quant[level][orientation] = vc2_qm_flat_tab[level][orientation]; } } } diff --git a/libavcodec/vc2enc_common.h b/libavcodec/vc2enc_common.h index 40c9ff85b5..b049fe5974 100644 --- a/libavcodec/vc2enc_common.h +++ b/libavcodec/vc2enc_common.h @@ -185,7 +185,7 @@ av_cold void vc2_init_static_data(void); void put_vc2_ue_uint(PutBitContext *pb, uint32_t val); -void vc2_init_quant_matrix(VC2EncContext *s); +void vc2_init_quant_matrix(VC2EncContext *s, int quant[MAX_DWT_LEVELS][4]); void vc2_encode_parse_info(VC2EncContext *s, enum DiracParseCodes pcode); -- 2.49.0 _______________________________________________ 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:[~2025-04-17 23:56 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-04-17 23:55 [FFmpeg-devel] [PATCH v3 1/5] libavcodec/vc2enc: Split out common functions between software and hardware encoders IndecisiveTurtle 2025-04-17 23:55 ` [FFmpeg-devel] [PATCH v3 2/5] libavcodec/vc2enc: Switch quant to int IndecisiveTurtle 2025-04-17 23:55 ` IndecisiveTurtle [this message] 2025-04-17 23:55 ` [FFmpeg-devel] [PATCH v3 4/5] libavcodec/vulkan: Add modifications to common shader for VC2 vulkan encoder IndecisiveTurtle 2025-04-17 23:55 ` [FFmpeg-devel] [PATCH v3 5/5] lavc: implement a Vulkan-based VC-2 encoder Implements a Vulkan based dirac encoder. Supports Haar and Legall wavelets and should work with all wavelet depths IndecisiveTurtle 2025-04-18 1:11 ` Lynne 2025-04-18 1:19 ` James Almer 2025-04-18 1:18 ` James Almer 2025-04-18 9:17 ` Andreas Rheinhardt 2025-04-18 9:32 ` Andreas Rheinhardt 2025-04-18 8:39 ` [FFmpeg-devel] [PATCH v3 1/5] libavcodec/vc2enc: Split out common functions between software and hardware encoders 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=20250417235543.227108-3-47210458+raphaelthegreat@users.noreply.github.com \ --to=geoster3d@gmail.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