Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] lavc/aarch64: fix hevc sao band filter
@ 2022-04-28 13:42 J. Dekker
  2022-04-28 13:42 ` [FFmpeg-devel] [PATCH 2/3] lavc/aarch64: add hevc sao edge 16x16 J. Dekker
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: J. Dekker @ 2022-04-28 13:42 UTC (permalink / raw)
  To: ffmpeg-devel

The SAO band filter can be called with non-multiples of 8, we round up
to the nearest multiple of 8 to account for this.

Signed-off-by: J. Dekker <jdek@itanimul.li>
---
 libavcodec/aarch64/hevcdsp_init_aarch64.c | 10 +++++-----
 libavcodec/aarch64/hevcdsp_sao_neon.S     |  8 ++++++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/libavcodec/aarch64/hevcdsp_init_aarch64.c b/libavcodec/aarch64/hevcdsp_init_aarch64.c
index 1e40be740c..c8963e6104 100644
--- a/libavcodec/aarch64/hevcdsp_init_aarch64.c
+++ b/libavcodec/aarch64/hevcdsp_init_aarch64.c
@@ -75,11 +75,11 @@ av_cold void ff_hevc_dsp_init_aarch64(HEVCDSPContext *c, const int bit_depth)
         c->idct_dc[1]                  = ff_hevc_idct_8x8_dc_8_neon;
         c->idct_dc[2]                  = ff_hevc_idct_16x16_dc_8_neon;
         c->idct_dc[3]                  = ff_hevc_idct_32x32_dc_8_neon;
-        // This function is disabled, as it doesn't handle widths that aren't
-        // an even multiple of 8 correctly. fate-hevc doesn't exercise that
-        // for the current size, but if enabled for bigger sizes, the cases
-        // of non-multiple of 8 seem to arise.
-//        c->sao_band_filter[0]          = ff_hevc_sao_band_filter_8x8_8_neon;
+        c->sao_band_filter[0]          =
+        c->sao_band_filter[1]          =
+        c->sao_band_filter[2]          =
+        c->sao_band_filter[3]          =
+        c->sao_band_filter[4]          = ff_hevc_sao_band_filter_8x8_8_neon;
     }
     if (bit_depth == 10) {
         c->add_residual[0]             = ff_hevc_add_residual_4x4_10_neon;
diff --git a/libavcodec/aarch64/hevcdsp_sao_neon.S b/libavcodec/aarch64/hevcdsp_sao_neon.S
index d523bf584d..e07e0cea2d 100644
--- a/libavcodec/aarch64/hevcdsp_sao_neon.S
+++ b/libavcodec/aarch64/hevcdsp_sao_neon.S
@@ -41,7 +41,11 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1
         and             w10, w10, #0x1F
         strh            w9, [sp, x10, lsl #1]
         bne             0b
+        add             w6,  w6,  #7
+        bic             w6,  w6,  #7
         ld1             {v16.16b-v19.16b}, [sp], #64
+        sub             x2,  x2,  x6
+        sub             x3,  x3,  x6
         movi            v20.8h,   #1
 1:      mov             w8,  w6                    // beginning of line
 2:      // Simple layout for accessing 16bit values
@@ -52,7 +56,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1
         // |xDE#xAD|xCA#xFE|xBE#xEF|xFE#xED|....
         // +----------------------------------->
         //    i-0     i-1     i-2     i-3
-        ld1             {v2.8b}, [x1]              // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]);
+        ld1             {v2.8b}, [x1], #8          // dst[x] = av_clip_pixel(src[x] + offset_table[src[x] >> shift]);
         uxtl            v0.8h,  v2.8b              // load src[x]
         ushr            v2.8h,  v0.8h, #3          // >> BIT_DEPTH - 3
         shl             v1.8h,  v2.8h, #1          // low (x2, accessing short)
@@ -61,7 +65,7 @@ function ff_hevc_sao_band_filter_8x8_8_neon, export=1
         tbx             v2.16b, {v16.16b-v19.16b}, v1.16b // table
         add             v1.8h,  v0.8h, v2.8h       // src[x] + table
         sqxtun          v4.8b,  v1.8h              // clip + narrow
-        st1             {v4.8b}, [x0]              // store
+        st1             {v4.8b}, [x0], #8          // store
         subs            w8, w8,  #8                // done 8 pixels
         bne             2b
         subs            w7, w7,  #1                // finished line, prep. new
-- 
2.32.0 (Apple Git-132)

_______________________________________________
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] 10+ messages in thread

end of thread, other threads:[~2022-05-25  7:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 13:42 [FFmpeg-devel] [PATCH 1/3] lavc/aarch64: fix hevc sao band filter J. Dekker
2022-04-28 13:42 ` [FFmpeg-devel] [PATCH 2/3] lavc/aarch64: add hevc sao edge 16x16 J. Dekker
2022-04-28 13:42 ` [FFmpeg-devel] [PATCH 3/3] lavc/aarch64: add hevc sao edge 8x8 J. Dekker
2022-04-28 19:50   ` Martin Storsjö
2022-05-17 11:53     ` J. Dekker
2022-05-17 11:54     ` [FFmpeg-devel] [PATCH] checkasm: improve hevc_sao test J. Dekker
2022-05-24 20:27       ` Martin Storsjö
2022-05-25  7:21         ` J. Dekker
2022-05-25  7:40           ` Martin Storsjö
2022-04-28 13:43 ` [FFmpeg-devel] [PATCH 1/3] lavc/aarch64: fix hevc sao band filter J. Dekker

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