* [FFmpeg-devel] [PATCH v1 1/2][GSoC 2024] libavcode/x86/vvc: change label to vvc_sad_16 to reflect block sizes
@ 2024-05-28 19:09 Stone Chen
2024-05-28 19:09 ` [FFmpeg-devel] [PATCH v1 2/2][GSoC 2024] tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes Stone Chen
0 siblings, 1 reply; 3+ messages in thread
From: Stone Chen @ 2024-05-28 19:09 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Stone Chen
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that 8x16, 16x8, and 16x16 are the only allowed sizes. This re-labels vvc_sad_16_128 to vvc_sad_16 to reflect this and adds a comment about the block size constraints. There's no functionality change.
---
libavcodec/x86/vvc/vvc_sad.asm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavcodec/x86/vvc/vvc_sad.asm b/libavcodec/x86/vvc/vvc_sad.asm
index b468d89ac2..982951a370 100644
--- a/libavcodec/x86/vvc/vvc_sad.asm
+++ b/libavcodec/x86/vvc/vvc_sad.asm
@@ -29,6 +29,7 @@ SECTION_RODATA
pw_1: times 2 dw 1
; DMVR SAD is only calculated on even rows to reduce complexity
+; Additionally the only valid sizes are 8x16, 16x8, and 16x16
SECTION .text
%macro MIN_MAX_SAD 3
@@ -77,7 +78,7 @@ cglobal vvc_sad, 6, 9, 5, src1, src2, dx, dy, block_w, block_h, off1, off2, row_
vpbroadcastd m4, [pw_1]
cmp block_wd, 16
- jge vvc_sad_16_128
+ je vvc_sad_16
vvc_sad_8:
.loop_height:
@@ -100,7 +101,7 @@ cglobal vvc_sad, 6, 9, 5, src1, src2, dx, dy, block_w, block_h, off1, off2, row_
movd eax, xm0
RET
- vvc_sad_16_128:
+ vvc_sad_16:
sar block_wd, 4
.loop_height:
mov off1q, src1q
--
2.45.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".
^ permalink raw reply [flat|nested] 3+ messages in thread
* [FFmpeg-devel] [PATCH v1 2/2][GSoC 2024] tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes
2024-05-28 19:09 [FFmpeg-devel] [PATCH v1 1/2][GSoC 2024] libavcode/x86/vvc: change label to vvc_sad_16 to reflect block sizes Stone Chen
@ 2024-05-28 19:09 ` Stone Chen
2024-05-29 13:45 ` Nuo Mi
0 siblings, 1 reply; 3+ messages in thread
From: Stone Chen @ 2024-05-28 19:09 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Stone Chen
According to the VVC specification (section 8.5.1), the maximum width/height of a subblock passed for DMVR SAD is 16. This along with previous constraint requiring width * height >= 128 means that 8x16, 16x8, and 16x16 are the only allowed sizes.
This changes check_vvc_sad() to only test and benchmark those sizes.
---
tests/checkasm/vvc_mc.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c
index 1e889e2cff..09cac82edb 100644
--- a/tests/checkasm/vvc_mc.c
+++ b/tests/checkasm/vvc_mc.c
@@ -337,11 +337,12 @@ static void check_vvc_sad(void)
memset(src1, 0, MAX_CTU_SIZE * MAX_CTU_SIZE * 4 * sizeof(uint16_t));
randomize_pixels(src0, src1, MAX_CTU_SIZE * MAX_CTU_SIZE * 4);
- for (int h = 8; h <= MAX_CTU_SIZE; h *= 2) {
- for (int w = 8; w <= MAX_CTU_SIZE; w *= 2) {
+ for (int h = 8; h <= 16; h *= 2) {
+ for (int w = 8; w <= 16; w *= 2) {
for(int offy = 0; offy <= 4; offy++) {
for(int offx = 0; offx <= 4; offx++) {
- if(check_func(c.inter.sad, "sad_%dx%d", w, h)) {
+ if(w * h >= 128) {
+ if(check_func(c.inter.sad, "sad_%dx%d", w, h)) {
int result0;
int result1;
@@ -350,13 +351,14 @@ static void check_vvc_sad(void)
if (result1 != result0)
fail();
- if(w == h && offx == 0 && offy == 0)
+ if(offx == 0 && offy == 0)
bench_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h);
+ }
}
}
}
}
- }
+ }
report("sad");
}
--
2.45.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".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH v1 2/2][GSoC 2024] tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes
2024-05-28 19:09 ` [FFmpeg-devel] [PATCH v1 2/2][GSoC 2024] tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes Stone Chen
@ 2024-05-29 13:45 ` Nuo Mi
0 siblings, 0 replies; 3+ messages in thread
From: Nuo Mi @ 2024-05-29 13:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Stone Chen
On Wed, May 29, 2024 at 3:10 AM Stone Chen <chen.stonechen@gmail.com> wrote:
> According to the VVC specification (section 8.5.1), the maximum
> width/height of a subblock passed for DMVR SAD is 16. This along with
> previous constraint requiring width * height >= 128 means that 8x16, 16x8,
> and 16x16 are the only allowed sizes
Applied.
Thank you, Stone.
>
>
This changes check_vvc_sad() to only test and benchmark those sizes.
> ---
> tests/checkasm/vvc_mc.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c
> index 1e889e2cff..09cac82edb 100644
> --- a/tests/checkasm/vvc_mc.c
> +++ b/tests/checkasm/vvc_mc.c
> @@ -337,11 +337,12 @@ static void check_vvc_sad(void)
> memset(src1, 0, MAX_CTU_SIZE * MAX_CTU_SIZE * 4 * sizeof(uint16_t));
>
> randomize_pixels(src0, src1, MAX_CTU_SIZE * MAX_CTU_SIZE * 4);
> - for (int h = 8; h <= MAX_CTU_SIZE; h *= 2) {
> - for (int w = 8; w <= MAX_CTU_SIZE; w *= 2) {
> + for (int h = 8; h <= 16; h *= 2) {
> + for (int w = 8; w <= 16; w *= 2) {
>
for(int offy = 0; offy <= 4; offy++) {
> for(int offx = 0; offx <= 4; offx++) {
> - if(check_func(c.inter.sad, "sad_%dx%d", w, h)) {
> + if(w * h >= 128) {
> + if(check_func(c.inter.sad, "sad_%dx%d", w, h)) {
> int result0;
> int result1;
>
> @@ -350,13 +351,14 @@ static void check_vvc_sad(void)
>
> if (result1 != result0)
> fail();
> - if(w == h && offx == 0 && offy == 0)
> + if(offx == 0 && offy == 0)
> bench_new(src0 + PIXEL_STRIDE * 2 + 2, src1 +
> PIXEL_STRIDE * 2 + 2, offx, offy, w, h);
> + }
> }
> }
> }
> }
> - }
> + }
>
> report("sad");
> }
> --
> 2.45.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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-29 13:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-28 19:09 [FFmpeg-devel] [PATCH v1 1/2][GSoC 2024] libavcode/x86/vvc: change label to vvc_sad_16 to reflect block sizes Stone Chen
2024-05-28 19:09 ` [FFmpeg-devel] [PATCH v1 2/2][GSoC 2024] tests/checkasm/vvc_mc: for SAD, only test valid subblock sizes Stone Chen
2024-05-29 13:45 ` Nuo Mi
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