mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-10 17:14:41 +00:00
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
d4556c98f0):
/*
* 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 <ffmpeg@marginal.org.uk>
This commit is contained in:
committed by
Emma Worley
parent
23881eef2b
commit
7587e1224a
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user