* [FFmpeg-devel] [PATCH] yuv4mpegenc: add bitdepth multiplier after rounding width.
@ 2023-04-17 15:00 Ronald S. Bultje
2023-04-19 13:51 ` Ronald S. Bultje
0 siblings, 1 reply; 2+ messages in thread
From: Ronald S. Bultje @ 2023-04-17 15:00 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Ronald S. Bultje
Fixes output of HBD odd-width chroma.
---
libavformat/yuv4mpegenc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index fc6b08e0cd..2fa5ee2714 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -195,13 +195,14 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
/* The following code presumes all planes to be non-interleaved. */
for (int k = 0; k < desc->nb_components; k++) {
- int plane_height = height, plane_width = width * desc->comp[k].step;
+ int plane_height = height, plane_width = width;
const uint8_t *ptr = frame->data[k];
if (desc->nb_components >= 3 && (k == 1 || k == 2)) { /* chroma? */
plane_width = AV_CEIL_RSHIFT(plane_width, desc->log2_chroma_w);
plane_height = AV_CEIL_RSHIFT(plane_height, desc->log2_chroma_h);
}
+ plane_width *= desc->comp[k].step;
for (int i = 0; i < plane_height; i++) {
avio_write(pb, ptr, plane_width);
--
2.38.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".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH] yuv4mpegenc: add bitdepth multiplier after rounding width.
2023-04-17 15:00 [FFmpeg-devel] [PATCH] yuv4mpegenc: add bitdepth multiplier after rounding width Ronald S. Bultje
@ 2023-04-19 13:51 ` Ronald S. Bultje
0 siblings, 0 replies; 2+ messages in thread
From: Ronald S. Bultje @ 2023-04-19 13:51 UTC (permalink / raw)
To: ffmpeg-devel
Hi,
On Mon, Apr 17, 2023 at 11:00 AM Ronald S. Bultje <rsbultje@gmail.com>
wrote:
> Fixes output of HBD odd-width chroma.
> ---
> libavformat/yuv4mpegenc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
> index fc6b08e0cd..2fa5ee2714 100644
> --- a/libavformat/yuv4mpegenc.c
> +++ b/libavformat/yuv4mpegenc.c
> @@ -195,13 +195,14 @@ static int yuv4_write_packet(AVFormatContext *s,
> AVPacket *pkt)
>
> /* The following code presumes all planes to be non-interleaved. */
> for (int k = 0; k < desc->nb_components; k++) {
> - int plane_height = height, plane_width = width *
> desc->comp[k].step;
> + int plane_height = height, plane_width = width;
> const uint8_t *ptr = frame->data[k];
>
> if (desc->nb_components >= 3 && (k == 1 || k == 2)) { /* chroma?
> */
> plane_width = AV_CEIL_RSHIFT(plane_width,
> desc->log2_chroma_w);
> plane_height = AV_CEIL_RSHIFT(plane_height,
> desc->log2_chroma_h);
> }
> + plane_width *= desc->comp[k].step;
>
> for (int i = 0; i < plane_height; i++) {
> avio_write(pb, ptr, plane_width);
> --
> 2.38.1
>
Applied.
Ronald
_______________________________________________
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] 2+ messages in thread
end of thread, other threads:[~2023-04-19 13:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-17 15:00 [FFmpeg-devel] [PATCH] yuv4mpegenc: add bitdepth multiplier after rounding width Ronald S. Bultje
2023-04-19 13:51 ` Ronald S. Bultje
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