[libav-devel] [PATCH] Dirac: add Comments and references to the standard

Diego Biurrun diego at biurrun.de
Sun May 20 15:17:39 CEST 2012


On Sat, May 19, 2012 at 09:49:28PM +0200, Jordi Ortiz wrote:
> 
> --- a/libavcodec/dirac.c
> +++ b/libavcodec/dirac.c
> @@ -22,7 +22,7 @@
>  /**
>   * @file
>   * Dirac Decoder
> - * @author Marco Gerards <marco at gnu.org>
> + * @author Marco Gerards <marco at gnu.org>, David Conrad
>   */
>  
>  #include "libavutil/imgutils.h"
> @@ -42,7 +42,6 @@ static const dirac_source_params dirac_source_parameters_defaults[] = {
>      { 704,  576,  2, 0, 1, 10, 3, 704,  576,  0, 0, 1, 2 },
>      { 720,  480,  1, 1, 0, 4,  2, 704,  480,  8, 0, 3, 1 },
>      { 720,  576,  1, 1, 1, 3,  3, 704,  576,  8, 0, 3, 2 },
> -
>      { 1280, 720,  1, 0, 1, 7,  1, 1280, 720,  0, 0, 3, 3 },
>      { 1280, 720,  1, 0, 1, 6,  1, 1280, 720,  0, 0, 3, 3 },
>      { 1920, 1080, 1, 1, 1, 4,  1, 1920, 1080, 0, 0, 3, 3 },
> @@ -51,13 +50,16 @@ static const dirac_source_params dirac_source_parameters_defaults[] = {
>      { 1920, 1080, 1, 0, 1, 6,  1, 1920, 1080, 0, 0, 3, 3 },
>      { 2048, 1080, 0, 0, 1, 2,  1, 2048, 1080, 0, 0, 4, 4 },
>      { 4096, 2160, 0, 0, 1, 2,  1, 4096, 2160, 0, 0, 4, 4 },
> -
>      { 3840, 2160, 1, 0, 1, 7,  1, 3840, 2160, 0, 0, 3, 3 },
>      { 3840, 2160, 1, 0, 1, 6,  1, 3840, 2160, 0, 0, 3, 3 },
>      { 7680, 4320, 1, 0, 1, 7,  1, 3840, 2160, 0, 0, 3, 3 },
>      { 7680, 4320, 1, 0, 1, 6,  1, 3840, 2160, 0, 0, 3, 3 },
>  };

These are unrelated changes, please keep them out of patches you send.

> @@ -164,19 +197,29 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
>              avctx->sample_aspect_ratio.den = svq3_get_ue_golomb(gb);
>          }
>      }
> +    /* [DIRAC_STD] Take value from Table 10.4 Available preset pixel
> +     *  aspect ratio values */
>      if (source->aspect_ratio_index > 0)
>          avctx->sample_aspect_ratio =
> -                dirac_preset_aspect_ratios[source->aspect_ratio_index-1];
> +            dirac_preset_aspect_ratios[source->aspect_ratio_index-1];

.. and another one.

> -    // Override signal range.
> -    if (get_bits1(gb)) {
> +    /*[DIRAC_STD] 10.3.8 Signal range. signal_range(video_params)
> +     * WARNING: Some adaptation seemed to be done using the
> +     * AVCOL_RANGE_MPEG/JPEG values */
> +    if (get_bits1(gb)) { /*[DIRAC_STD] custom_signal_range_flag */
> +        /*[DIRAC_STD] index */
>          source->pixel_range_index = svq3_get_ue_golomb(gb);

missing spaces after '*'

> @@ -186,12 +229,15 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
>          if (!source->pixel_range_index) {
>              luma_offset = svq3_get_ue_golomb(gb);
>              luma_depth  = av_log2(svq3_get_ue_golomb(gb))+1;
> -            svq3_get_ue_golomb(gb); // chroma offset
> -            svq3_get_ue_golomb(gb); // chroma excursion
> +            svq3_get_ue_golomb(gb); /* chroma offset    */
> +            svq3_get_ue_golomb(gb); /* chroma excursion */
> +            /*  @Jordi: Why are these two ignored? */

stray change

> +    /*[DIRAC_STD] Table 10.5
> +     * Available signal range presets <--> pixel_range_presets */
>      if (source->pixel_range_index > 0) {
>          idx                = source->pixel_range_index-1;

missing space after '*'

Diego


More information about the libav-devel mailing list