From: Nuo Mi <nuomi2021@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: Nuo Mi <nuomi2021@gmail.com> Subject: [FFmpeg-devel] [PATCH 09/18] avcodec/vvcdec: add vvc inter filters for RPR Date: Sun, 19 May 2024 21:27:40 +0800 Message-ID: <TYSPR06MB64339D77ED5631307A022614AAE82@TYSPR06MB6433.apcprd06.prod.outlook.com> (raw) In-Reply-To: <20240519132749.790832-1-nuomi2021@gmail.com> --- libavcodec/vvc/data.c | 83 ++++++++++++++++++++++++++++++++++++++++- libavcodec/vvc/data.h | 10 +++-- libavcodec/vvc/inter.c | 8 ++-- tests/checkasm/vvc_mc.c | 12 +++--- 4 files changed, 98 insertions(+), 15 deletions(-) diff --git a/libavcodec/vvc/data.c b/libavcodec/vvc/data.c index ace585b663..a91e20754e 100644 --- a/libavcodec/vvc/data.c +++ b/libavcodec/vvc/data.c @@ -1732,7 +1732,7 @@ const uint8_t ff_vvc_alf_aps_class_to_filt_map[25] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, }; -const int8_t ff_vvc_inter_luma_filters[VVC_INTER_FILTER_TYPES][VVC_INTER_LUMA_FACTS][VVC_INTER_LUMA_TAPS] = { +const int8_t ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPES][VVC_INTER_LUMA_FACTS][VVC_INTER_LUMA_TAPS] = { { //1x, hpelIfIdx == 0, Table 27 { 0, 0, 0, 64, 0, 0, 0, 0 }, @@ -1773,6 +1773,46 @@ const int8_t ff_vvc_inter_luma_filters[VVC_INTER_FILTER_TYPES][VVC_INTER_LUMA_FA { 0, 1, -2, 4, 63, -3, 1, 0 }, }, + { + //1.5x, Table 28 + { -1, -5, 17, 42, 17, -5, -1, 0 }, + { 0, -5, 15, 41, 19, -5, -1, 0 }, + { 0, -5, 13, 40, 21, -4, -1, 0 }, + { 0, -5, 11, 39, 24, -4, -2, 1 }, + { 0, -5, 9, 38, 26, -3, -2, 1 }, + { 0, -5, 7, 38, 28, -2, -3, 1 }, + { 1, -5, 5, 36, 30, -1, -3, 1 }, + { 1, -4, 3, 35, 32, 0, -4, 1 }, + { 1, -4, 2, 33, 33, 2, -4, 1 }, + { 1, -4, 0, 32, 35, 3, -4, 1 }, + { 1, -3, -1, 30, 36, 5, -5, 1 }, + { 1, -3, -2, 28, 38, 7, -5, 0 }, + { 1, -2, -3, 26, 38, 9, -5, 0 }, + { 1, -2, -4, 24, 39, 11, -5, 0 }, + { 0, -1, -4, 21, 40, 13, -5, 0 }, + { 0, -1, -5, 19, 41, 15, -5, 0 }, + }, + + { + //2x, Table 29 + { -4, 2, 20, 28, 20, 2, -4, 0 }, + { -4, 0, 19, 29, 21, 5, -4, -2 }, + { -4, -1, 18, 29, 22, 6, -4, -2 }, + { -4, -1, 16, 29, 23, 7, -4, -2 }, + { -4, -1, 16, 28, 24, 7, -4, -2 }, + { -4, -1, 14, 28, 25, 8, -4, -2 }, + { -3, -3, 14, 27, 26, 9, -3, -3 }, + { -3, -1, 12, 28, 25, 10, -4, -3 }, + { -3, -3, 11, 27, 27, 11, -3, -3 }, + { -3, -4, 10, 25, 28, 12, -1, -3 }, + { -3, -3, 9, 26, 27, 14, -3, -3 }, + { -2, -4, 8, 25, 28, 14, -1, -4 }, + { -2, -4, 7, 24, 28, 16, -1, -4 }, + { -2, -4, 7, 23, 29, 16, -1, -4 }, + { -2, -4, 6, 22, 29, 18, -1, -4 }, + { -2, -4, 5, 21, 29, 19, 0, -4 }, + }, + { //1x, affine, Table 30 { 0, 0, 0, 64, 0, 0, 0, 0 }, @@ -1793,9 +1833,48 @@ const int8_t ff_vvc_inter_luma_filters[VVC_INTER_FILTER_TYPES][VVC_INTER_LUMA_FA { 0, 1, -2, 4, 63, -3, 1, 0 }, }, + { + //1.5x, affine, Table 31 + { 0, -6, 17, 42, 17, -5, -1, 0 }, + { 0, -5, 15, 41, 19, -5, -1, 0 }, + { 0, -5, 13, 40, 21, -4, -1, 0 }, + { 0, -5, 11, 39, 24, -4, -1, 0 }, + { 0, -5, 9, 38, 26, -3, -1, 0 }, + { 0, -5, 7, 38, 28, -2, -2, 0 }, + { 0, -4, 5, 36, 30, -1, -2, 0 }, + { 0, -3, 3, 35, 32, 0, -3, 0 }, + { 0, -3, 2, 33, 33, 2, -3, 0 }, + { 0, -3, 0, 32, 35, 3, -3, 0 }, + { 0, -2, -1, 30, 36, 5, -4, 0 }, + { 0, -2, -2, 28, 38, 7, -5, 0 }, + { 0, -1, -3, 26, 38, 9, -5, 0 }, + { 0, -1, -4, 24, 39, 11, -5, 0 }, + { 0, -1, -4, 21, 40, 13, -5, 0 }, + { 0, -1, -5, 19, 41, 15, -5, 0 }, + }, + + { + //2x, affine, Table 32 + { 0, -2, 20, 28, 20, 2, -4, 0 }, + { 0, -4, 19, 29, 21, 5, -6, 0 }, + { 0, -5, 18, 29, 22, 6, -6, 0 }, + { 0, -5, 16, 29, 23, 7, -6, 0 }, + { 0, -5, 16, 28, 24, 7, -6, 0 }, + { 0, -5, 14, 28, 25, 8, -6, 0 }, + { 0, -6, 14, 27, 26, 9, -6, 0 }, + { 0, -4, 12, 28, 25, 10, -7, 0 }, + { 0, -6, 11, 27, 27, 11, -6, 0 }, + { 0, -7, 10, 25, 28, 12, -4, 0 }, + { 0, -6, 9, 26, 27, 14, -6, 0 }, + { 0, -6, 8, 25, 28, 14, -5, 0 }, + { 0, -6, 7, 24, 28, 16, -5, 0 }, + { 0, -6, 7, 23, 29, 16, -5, 0 }, + { 0, -6, 6, 22, 29, 18, -5, 0 }, + { 0, -6, 5, 21, 29, 19, -4, 0 }, + } }; -const int8_t ff_vvc_inter_chroma_filters[VVC_INTER_FILTER_TYPES][VVC_INTER_CHROMA_FACTS][VVC_INTER_CHROMA_TAPS] = { +const int8_t ff_vvc_inter_chroma_filters[VVC_INTER_CHROMA_FILTER_TYPES][VVC_INTER_CHROMA_FACTS][VVC_INTER_CHROMA_TAPS] = { { //1x, Table 33 { 0, 64, 0, 0 }, diff --git a/libavcodec/vvc/data.h b/libavcodec/vvc/data.h index e493b9e0e6..a0512e626b 100644 --- a/libavcodec/vvc/data.h +++ b/libavcodec/vvc/data.h @@ -43,15 +43,19 @@ extern const int8_t ff_vvc_lfnst_8x8[4][2][16][48]; extern const uint8_t ff_vvc_lfnst_tr_set_index[95]; extern uint8_t ff_vvc_default_scale_m[64 * 64]; -#define VVC_INTER_FILTER_TYPES 3 +#define VVC_INTER_LUMA_FILTER_TYPE_AFFINE 4 + +#define VVC_INTER_LUMA_FILTER_TYPES 7 +#define VVC_INTER_CHROMA_FILTER_TYPES 3 + #define VVC_INTER_LUMA_FACTS 16 #define VVC_INTER_LUMA_TAPS 8 #define VVC_INTER_CHROMA_FACTS 32 #define VVC_INTER_CHROMA_TAPS 4 #define VVC_INTER_LUMA_DMVR_FACTS 16 #define VVC_INTER_LUMA_DMVR_TAPS 2 -extern const int8_t ff_vvc_inter_luma_filters[VVC_INTER_FILTER_TYPES][VVC_INTER_LUMA_FACTS][VVC_INTER_LUMA_TAPS]; -extern const int8_t ff_vvc_inter_chroma_filters[VVC_INTER_FILTER_TYPES][VVC_INTER_CHROMA_FACTS][VVC_INTER_CHROMA_TAPS]; +extern const int8_t ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPES][VVC_INTER_LUMA_FACTS][VVC_INTER_LUMA_TAPS]; +extern const int8_t ff_vvc_inter_chroma_filters[VVC_INTER_CHROMA_FILTER_TYPES][VVC_INTER_CHROMA_FACTS][VVC_INTER_CHROMA_TAPS]; extern const int8_t ff_vvc_inter_luma_dmvr_filters[VVC_INTER_LUMA_DMVR_FACTS][VVC_INTER_LUMA_DMVR_TAPS]; #define VVC_INTRA_LUMA_TYPES 2 diff --git a/libavcodec/vvc/inter.c b/libavcodec/vvc/inter.c index 23d9ac05e6..31c6f43916 100644 --- a/libavcodec/vvc/inter.c +++ b/libavcodec/vvc/inter.c @@ -320,8 +320,8 @@ static void luma_prof_uni(VVCLocalContext *lc, uint8_t *dst, const ptrdiff_t dst const Mv *mv = mvf->mv + lx; const int mx = mv->x & 0xf; const int my = mv->y & 0xf; - const int8_t *hf = ff_vvc_inter_luma_filters[2][mx]; - const int8_t *vf = ff_vvc_inter_luma_filters[2][my]; + const int8_t *hf = ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPE_AFFINE][mx]; + const int8_t *vf = ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPE_AFFINE][my]; int denom, wx, ox; const int weight_flag = derive_weight_uni(&denom, &wx, &ox, lc, mvf, LUMA); const int is_chroma = 0; @@ -368,8 +368,8 @@ static void luma_prof_bi(VVCLocalContext *lc, uint8_t *dst, const ptrdiff_t dst_ const int oy = y_off + (mv->y >> 4); ptrdiff_t src_stride = ref[i]->linesize[0]; const uint8_t *src = ref[i]->data[0] + oy * src_stride + (ox * (1 << fc->ps.sps->pixel_shift)); - const int8_t *hf = ff_vvc_inter_luma_filters[2][mx]; - const int8_t *vf = ff_vvc_inter_luma_filters[2][my]; + const int8_t *hf = ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPE_AFFINE][mx]; + const int8_t *vf = ff_vvc_inter_luma_filters[VVC_INTER_LUMA_FILTER_TYPE_AFFINE][my]; MC_EMULATED_EDGE(lc->edge_emu_buffer, &src, &src_stride, ox, oy); if (!pu->cb_prof_flag[i]) { diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c index 71087dc3dd..a5ec7b7869 100644 --- a/tests/checkasm/vvc_mc.c +++ b/tests/checkasm/vvc_mc.c @@ -134,8 +134,8 @@ static void check_put_vvc_luma_uni(void) const int idx = av_log2(w) - 1; const int mx = rnd() % VVC_INTER_LUMA_FACTS; const int my = rnd() % VVC_INTER_LUMA_FACTS; - const int8_t *hf = ff_vvc_inter_luma_filters[rnd() % VVC_INTER_FILTER_TYPES][mx]; - const int8_t *vf = ff_vvc_inter_luma_filters[rnd() % VVC_INTER_FILTER_TYPES][my]; + const int8_t *hf = ff_vvc_inter_luma_filters[rnd() % VVC_INTER_LUMA_FILTER_TYPES][mx]; + const int8_t *vf = ff_vvc_inter_luma_filters[rnd() % VVC_INTER_LUMA_FILTER_TYPES][my]; const char *type; switch ((j << 1) | i) { @@ -184,8 +184,8 @@ static void check_put_vvc_chroma(void) const int idx = av_log2(w) - 1; const int mx = rnd() % VVC_INTER_CHROMA_FACTS; const int my = rnd() % VVC_INTER_CHROMA_FACTS; - const int8_t *hf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][mx]; - const int8_t *vf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][my]; + const int8_t *hf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_CHROMA_FILTER_TYPES][mx]; + const int8_t *vf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_CHROMA_FILTER_TYPES][my]; const char *type; switch ((j << 1) | i) { case 0: type = "put_chroma_pixels"; break; // 0 0 @@ -233,8 +233,8 @@ static void check_put_vvc_chroma_uni(void) const int idx = av_log2(w) - 1; const int mx = rnd() % VVC_INTER_CHROMA_FACTS; const int my = rnd() % VVC_INTER_CHROMA_FACTS; - const int8_t *hf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][mx]; - const int8_t *vf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_FILTER_TYPES][my]; + const int8_t *hf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_CHROMA_FILTER_TYPES][mx]; + const int8_t *vf = ff_vvc_inter_chroma_filters[rnd() % VVC_INTER_CHROMA_FILTER_TYPES][my]; const char *type; switch ((j << 1) | i) { -- 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:[~2024-05-19 13:41 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20240519132749.790832-1-nuomi2021@gmail.com> 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vvcdec: refact, unify {luma, chroma}_mc to mc Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vvcdec: refact, unify {luma, chroma}_mc_uni to mc_uni Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vvcdec: refact, unify {luma, chroma}_mc_bi to mc_bi Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vvcdec: misc, remove unused EMULATED_EDGE_{LUMA, CHROMA}, EMULATED_EDGE_DMVR_{LUAM, CHROMA} Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vvcdec: refact, unify pred_regular_{luma, chroma} to pred_regular Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vvcdec: refact out VVCRefPic from RefPicList Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vvcdec: refact, pred_get_refs return VVCRefPic instead of VVCFrame Nuo Mi 2024-05-19 13:27 ` Nuo Mi [this message] 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vvcdec: emulated_edge, use reference frame's sps and pps Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vvcdec: add RPR dsp Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vvcdec: inter, wait reference with a diffrent resolution Nuo Mi 2024-05-19 15:20 ` Jean-Baptiste Kempf 2024-05-20 13:25 ` Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vvcdec: fix dmvr, bdof, cb_prof for RPR Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 14/18] avcodec/vvcdec: refact out luma_prof from luma_prof_bi Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vvcdec: refact, remove hf_idx and vf_idx from mc_xxx's param list Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vvcdec: increase edge_emu_buffer for RPR Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vvcdec: support Reference Picture Resampling Nuo Mi 2024-05-19 13:27 ` [FFmpeg-devel] [PATCH 18/18] Changelog: add DVB compatible information for VVC decoder Nuo Mi 2024-05-21 12:32 ` Nuo Mi
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=TYSPR06MB64339D77ED5631307A022614AAE82@TYSPR06MB6433.apcprd06.prod.outlook.com \ --to=nuomi2021@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