This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 7587e1224a libavcodec/dxv.c: handle widths not a multiple of 16
7587e1224a is described below

commit 7587e1224ae9f93fbb3a6340afc8092bbc67a450
Author:     Jonathan Harris <[email protected]>
AuthorDate: Mon Jun 22 11:10:40 2026 +0100
Commit:     Emma Worley <[email protected]>
CommitDate: Wed Jun 24 13:49:42 2026 -0700

    libavcodec/dxv.c: handle widths not a multiple of 16
    
    The Resolume DXV codec is based on 4x4 pixel DXT1/DXT5/BC4/BC5 blocks, so
    it's natural to assume that files would be padded to multiples of 4 in width
    and height. But in practice .mov files produced by the Resolume software are
    always padded to multiples of 16 in width and height, so FFmpeg currently
    decodes them incorrectly.
    
    When encoding FFmpeg already pads both width and height to 16 so no change
    is required - see libavcodec/dxvenc.c:37-40 (commit
    d4556c98f02e4f2d3deb86efeb060ebe4659be96):
    
    /*
     * Resolume will refuse to display frames that are not padded to 16x16 
pixels.
     */
    #define DXV_ALIGN(x) FFALIGN(x, 16)
    
    Signed-off-by: Jonathan Harris <[email protected]>
---
 libavcodec/dxv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 344c7b2f3c..bae46cdee0 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -1089,8 +1089,8 @@ static av_cold int dxv_init(AVCodecContext *avctx)
         return ret;
     }
 
-    /* Since codec is based on 4x4 blocks, size is aligned to 4 */
-    avctx->coded_width  = FFALIGN(avctx->width,  TEXTURE_BLOCK_W);
+    /* Codec is based on 4x4 blocks, but in practice width is aligned to 16 */
+    avctx->coded_width  = FFALIGN(avctx->width,  16);
     avctx->coded_height = FFALIGN(avctx->height, TEXTURE_BLOCK_H);
 
     ff_texturedsp_init(&ctx->texdsp);

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to