[FFmpeg-devel] [PATCH] avcodec/dxv: add support for "high" quality mode

Michael Niedermayer michael at niedermayer.cc
Thu Apr 12 16:55:44 EEST 2018


On Thu, Apr 12, 2018 at 02:42:11PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/dxv.c | 1032 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 1003 insertions(+), 29 deletions(-)
> 
> diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
> index 529e211258..cd7b693663 100644
> --- a/libavcodec/dxv.c
> +++ b/libavcodec/dxv.c
> @@ -1,6 +1,7 @@
>  /*
>   * Resolume DXV decoder
>   * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara at gmail.com>
> + * Copyright (C) 2018 Paul B Mahol
>   *
>   * This file is part of FFmpeg.
>   *

[...]

> @@ -169,6 +368,728 @@ static int dxv_decompress_dxt1(AVCodecContext *avctx)
>      return 0;
>  }
>  
> +typedef struct OpcodeTable {
> +    int16_t next;
> +    uint8_t val1;
> +    uint8_t val2;
> +} OpcodeTable;
> +

> +static int fill_ltable(GetByteContext *gb, uint32_t *table, int *nb_elements)
> +{
> +    unsigned half = 512, bits = 1023, left = 1024, input, mask;
> +    int value, counter = 0, rshift = 10, lshift = 30;
> +
> +    mask = bytestream2_get_le32(gb) >> 2;
> +    while (left) {

> +        if (bytestream2_get_bytes_left(gb) < 0 || counter >= 256)

bytestream2_get_bytes_left returns unsigned so it cannot be negative


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180412/51c5157c/attachment.sig>


More information about the ffmpeg-devel mailing list