From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec/asvenc: Don't waste bits encoding non-visible part
Date: Mon, 26 May 2025 08:20:38 +0300 (EEST)
Message-ID: <b2e32ef-e87-4e9f-5c70-3c39b34d491a@martin.st> (raw)
In-Reply-To: <20250526015254.3BAED41283C@natalya.videolan.org>
On Mon, 26 May 2025, Andreas Rheinhardt wrote:
> ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | Thu May 22 15:57:13 2025 +0200| [0401ca714a2714743573e27c384ffa810fd31a92] | committer: Andreas Rheinhardt
>
> avcodec/asvenc: Don't waste bits encoding non-visible part
>
> Up until now, the encoder replicated all the border pixels
> for incomplete 16x16 macroblocks. In case the available width
> or height is <= 8, some of the luma blocks of the MB
> do not correspond to actual input, so that we should encode
> them using the least amount of bits. Zeroing the block coefficients
> (as this commit does) achieves this, replicating the pixels
> and performing an FDCT does not.
>
> This commit also removes the frame copying code for insufficiently
> aligned dimensions.
>
> The vsynth3-asv[12] FATE tests use a 34x34 input file and are
> therefore affected by this. As the ref updates show, the size
> and checksum of the encoded changes, yet the decoded output
> stays the same.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0401ca714a2714743573e27c384ffa810fd31a92
> ---
>
> libavcodec/asvenc.c | 131 ++++++++++++++++++++++++++----------------
> tests/ref/vsynth/vsynth3-asv1 | 4 +-
> tests/ref/vsynth/vsynth3-asv2 | 4 +-
> 3 files changed, 84 insertions(+), 55 deletions(-)
As noted on irc, this broke the fate-vsynth3-asv1 and fate-vsynth3-asv2
tests on arm.
The issue is not AV_COPY128 as Andreas wondered on irc; the reason is
a->pdsp.get_pixels. We have a backtrace like this:
#0 0x00cfdd2a in ff_get_pixels_neon ()
at src/libavcodec/arm/pixblockdsp_neon.S:47
#1 0x0082ea54 in dct_get (mb_y=0, mb_x=0, frame=0xf6202f40, a=0x297f450)
at src/libavcodec/asvenc.c:222
#2 encode_frame (avctx=0x297f150, pkt=0xf6202ec0, pict=0xf6202f40,
got_packet=0xf7df4af0) at src/libavcodec/asvenc.c:304
The arguments to a->pdsp.get_pixels are this on entry:
(gdb) info registers r0 r1 r2
r0 0x297f4a0 43512992
r1 0x297caa0 43502240
r2 0x22 34
After one iteration, it hits the bus error due to unaligned reads from the
source, which was expected to stay aligned after incrementing by the
stride.
// Martin
_______________________________________________
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 parent reply other threads:[~2025-05-26 5:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250526015254.3BAED41283C@natalya.videolan.org>
2025-05-26 5:20 ` Martin Storsjö [this message]
2025-05-26 13:06 ` Andreas Rheinhardt
2025-05-26 13:21 ` James Almer
2025-05-26 13:22 ` Andreas Rheinhardt
2025-05-26 14:31 ` James Almer
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=b2e32ef-e87-4e9f-5c70-3c39b34d491a@martin.st \
--to=martin@martin.st \
--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