[FFmpeg-devel] [PATCH 3/3] Support DTS-ES extension (XCh) in dca

Benjamin Larsson banan
Mon Jun 21 00:24:09 CEST 2010


On 20/06/10 23:57, Nick Brereton wrote:
> 
> Index: libavcodec/dca.c
> ===================================================================
> --- libavcodec/dca.c	2010-06-20 22:14:08.000000000 +0100
> +++ libavcodec/dca.c	2010-06-20 22:17:53.000000000 +0100
> @@ -1,4 +1,4 @@
> -/*
> + /*


Still there.

>   * DCA compatible decoder
>   * Copyright (C) 2004 Gildas Bazin
>   * Copyright (C) 2004 Benjamin Zores
> @@ -41,10 +41,11 @@
>  
>  //#define TRACE
>  
> -#define DCA_PRIM_CHANNELS_MAX (5)
> +#define DCA_PRIM_CHANNELS_MAX (7)
>  #define DCA_SUBBANDS (32)
>  #define DCA_ABITS_MAX (32)      /* Should be 28 */
>  #define DCA_SUBSUBFRAMES_MAX (4)
> +#define DCA_SUBFRAMES_MAX (16)
>  #define DCA_BLOCKS_MAX (16)
>  #define DCA_LFE_MAX (3)
>  
> @@ -95,44 +96,81 @@
>      1,2,2,2,2,3,2,3,2,3,2,3,1,3,2,3
>  };
>  

Move the tables to its own patch. It is ok to be commited.

> -static const int8_t dca_channel_reorder_lfe[][8] = {
> -    { 0, -1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 2,  0,  1, -1, -1, -1, -1, -1},
> -    { 0,  1,  3, -1, -1, -1, -1, -1},
> -    { 2,  0,  1,  4, -1, -1, -1, -1},
> -    { 0,  1,  3,  4, -1, -1, -1, -1},
> -    { 2,  0,  1,  4,  5, -1, -1, -1},
> -    { 3,  4,  0,  1,  5,  6, -1, -1},
> -    { 2,  0,  1,  4,  5,  6, -1, -1},
> -    { 0,  6,  4,  5,  2,  3, -1, -1},
> -    { 4,  2,  5,  0,  1,  6,  7, -1},
> -    { 5,  6,  0,  1,  7,  3,  8,  4},
> -    { 4,  2,  5,  0,  1,  6,  8,  7},
> +static const int8_t dca_channel_reorder_lfe[][9] = {
> +    { 0, -1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 2,  0,  1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  4, -1, -1, -1, -1, -1},
> +    { 0,  1,  3,  4, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  4,  5, -1, -1, -1, -1},
> +    { 3,  4,  0,  1,  5,  6, -1, -1, -1},
> +    { 2,  0,  1,  4,  5,  6, -1, -1, -1},
> +    { 0,  6,  4,  5,  2,  3, -1, -1, -1},
> +    { 4,  2,  5,  0,  1,  6,  7, -1, -1},
> +    { 5,  6,  0,  1,  7,  3,  8,  4, -1},
> +    { 4,  2,  5,  0,  1,  6,  8,  7, -1},
>  };
>  
> -static const int8_t dca_channel_reorder_nolfe[][8] = {
> -    { 0, -1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 0,  1, -1, -1, -1, -1, -1, -1},
> -    { 2,  0,  1, -1, -1, -1, -1, -1},
> -    { 0,  1,  2, -1, -1, -1, -1, -1},
> -    { 2,  0,  1,  3, -1, -1, -1, -1},
> -    { 0,  1,  2,  3, -1, -1, -1, -1},
> -    { 2,  0,  1,  3,  4, -1, -1, -1},
> -    { 2,  3,  0,  1,  4,  5, -1, -1},
> -    { 2,  0,  1,  3,  4,  5, -1, -1},
> -    { 0,  5,  3,  4,  1,  2, -1, -1},
> -    { 3,  2,  4,  0,  1,  5,  6, -1},
> -    { 4,  5,  0,  1,  6,  2,  7,  3},
> -    { 3,  2,  4,  0,  1,  5,  7,  6},
> +static const int8_t dca_channel_reorder_lfe_xch[][9] = {
> +    { 0,  2, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  3, -1, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  4, -1, -1, -1, -1, -1},
> +    { 0,  1,  3,  4, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  4,  5, -1, -1, -1, -1},
> +    { 0,  1,  4,  5,  3, -1, -1, -1, -1},
> +    { 2,  0,  1,  5,  6,  4, -1, -1, -1},
> +    { 3,  4,  0,  1,  6,  7,  5, -1, -1},
> +    { 2,  0,  1,  4,  5,  6,  7, -1, -1},
> +    { 0,  6,  4,  5,  2,  3,  7, -1, -1},
> +    { 4,  2,  5,  0,  1,  7,  8,  6, -1},
> +    { 5,  6,  0,  1,  8,  3,  9,  4,  7},
> +    { 4,  2,  5,  0,  1,  6,  9,  8,  7},
>  };
>  
> +static const int8_t dca_channel_reorder_nolfe[][9] = {
> +    { 0, -1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 2,  0,  1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  3, -1, -1, -1, -1, -1},
> +    { 0,  1,  2,  3, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  3,  4, -1, -1, -1, -1},
> +    { 2,  3,  0,  1,  4,  5, -1, -1, -1},
> +    { 2,  0,  1,  3,  4,  5, -1, -1, -1},
> +    { 0,  5,  3,  4,  1,  2, -1, -1, -1},
> +    { 3,  2,  4,  0,  1,  5,  6, -1, -1},
> +    { 4,  5,  0,  1,  6,  2,  7,  3, -1},
> +    { 3,  2,  4,  0,  1,  5,  7,  6, -1},
> +};
> +
> +static const int8_t dca_channel_reorder_nolfe_xch[][9] = {
> +    { 0,  1, -1, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
> +    { 0,  1,  2, -1, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  3, -1, -1, -1, -1, -1},
> +    { 0,  1,  2,  3, -1, -1, -1, -1, -1},
> +    { 2,  0,  1,  3,  4, -1, -1, -1, -1},
> +    { 0,  1,  3,  4,  2, -1, -1, -1, -1},
> +    { 2,  0,  1,  4,  5,  3, -1, -1, -1},
> +    { 2,  3,  0,  1,  5,  6,  4, -1, -1},
> +    { 2,  0,  1,  3,  4,  5,  6, -1, -1},
> +    { 0,  5,  3,  4,  1,  2,  6, -1, -1},
> +    { 3,  2,  4,  0,  1,  6,  7,  5, -1},
> +    { 4,  5,  0,  1,  7,  2,  8,  3,  6},
> +    { 3,  2,  4,  0,  1,  5,  8,  7,  6},
> +};
>  



MvH
Benjamin Larsson



More information about the ffmpeg-devel mailing list