[FFmpeg-devel] [PATCH 07/11] diracdec: Replace dirac parse codes with better ones

Michael Niedermayer michaelni at gmx.at
Wed Dec 9 12:20:42 CET 2015


On Wed, Dec 09, 2015 at 12:05:33AM +0000, Kieran Kunhya wrote:
> ---
>  libavcodec/dirac.h    | 22 ++++++++++++++++++++++
>  libavcodec/diracdec.c | 18 +++---------------
>  2 files changed, 25 insertions(+), 15 deletions(-)
> 
> diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h
> index 6852e82..b4982f8 100644
> --- a/libavcodec/dirac.h
> +++ b/libavcodec/dirac.h
> @@ -34,6 +34,28 @@
>  #include "avcodec.h"
>  #include "get_bits.h"
>  
> +/**
> + * Parse code values:
> + *
> + * Dirac Specification ->
> + * 9.6.1  Table 9.1
> + *
> + * VC-2 Specification  ->
> + * 10.4.1 Table 10.1
> + */
> +
> +enum DiracParseCodes {
> +    DIRAC_PCODE_SEQ_HEADER      = 0x00,
> +    DIRAC_PCODE_END_SEQ         = 0x10,
> +    DIRAC_PCODE_AUX             = 0x20,
> +    DIRAC_PCODE_PAD             = 0x30,
> +    DIRAC_PCODE_PICTURE_CODED   = 0x08,
> +    DIRAC_PCODE_PICTURE_RAW     = 0x48,
> +    DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8,
> +    DIRAC_PCODE_PICTURE_HQ      = 0xE8,
> +    DIRAC_PCODE_MAGIC           = 0x42424344,
> +};
> +
>  typedef struct DiracVersionInfo {
>      int major;
>      int minor;
> diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
> index 5b0634c..c42360d 100644
> --- a/libavcodec/diracdec.c
> +++ b/libavcodec/diracdec.c
> @@ -226,17 +226,6 @@ typedef struct DiracContext {
>      DiracFrame all_frames[MAX_FRAMES];
>  } DiracContext;
>  
> -/**
> - * Dirac Specification ->
> - * Parse code values. 9.6.1 Table 9.1
> - */
> -enum dirac_parse_code {
> -    pc_seq_header         = 0x00,
> -    pc_eos                = 0x10,
> -    pc_aux_data           = 0x20,
> -    pc_padding            = 0x30,
> -};
> -
>  enum dirac_subband {
>      subband_ll = 0,
>      subband_hl = 1,
> @@ -1909,14 +1898,13 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
>  
>      init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE));
>  
> -    if (parse_code == pc_seq_header) {
> +    if (parse_code == DIRAC_PCODE_SEQ_HEADER) {
>          if (s->seen_sequence_header)
>              return 0;
>  
>          /* [DIRAC_STD] 10. Sequence header */
>          ret = avpriv_dirac_parse_sequence_header(avctx, &s->gb, &s->source, &s->version,
>                                                   &s->bit_depth);

> -        s->pshift = s->bit_depth > 8;
>          if (ret < 0)

this looks like it belongs to a different patch otherwise, should be
ok

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151209/ea5701d4/attachment.sig>


More information about the ffmpeg-devel mailing list