Path: blob/a-new-beginning/libavcodec.xcframework/macos-arm64/libavcodec.framework/Versions/A/Headers/dirac.h
2 views
/*1* Copyright (C) 2007 Marco Gerards <[email protected]>2* Copyright (C) 2009 David Conrad3* Copyright (C) 2011 Jordi Ortiz4*5* This file is part of FFmpeg.6*7* FFmpeg is free software; you can redistribute it and/or8* modify it under the terms of the GNU Lesser General Public9* License as published by the Free Software Foundation; either10* version 2.1 of the License, or (at your option) any later version.11*12* FFmpeg is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU15* Lesser General Public License for more details.16*17* You should have received a copy of the GNU Lesser General Public18* License along with FFmpeg; if not, write to the Free Software19* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20*/2122#ifndef AVCODEC_DIRAC_H23#define AVCODEC_DIRAC_H2425/**26* @file27* Interface to Dirac Decoder/Encoder28* @author Marco Gerards <[email protected]>29* @author David Conrad30* @author Jordi Ortiz31*/3233#include "avcodec.h"3435/**36* The spec limits the number of wavelet decompositions to 4 for both37* level 1 (VC-2) and 128 (long-gop default).38* 5 decompositions is the maximum before >16-bit buffers are needed.39* Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting40* the others to 4 decompositions (or 3 for the fidelity filter).41*42* We use this instead of MAX_DECOMPOSITIONS to save some memory.43*/44#define MAX_DWT_LEVELS 54546/**47* Parse code values:48*49* Dirac Specification ->50* 9.6.1 Table 9.151*52* VC-2 Specification ->53* 10.4.1 Table 10.154*/5556enum DiracParseCodes {57DIRAC_PCODE_SEQ_HEADER = 0x00,58DIRAC_PCODE_END_SEQ = 0x10,59DIRAC_PCODE_AUX = 0x20,60DIRAC_PCODE_PAD = 0x30,61DIRAC_PCODE_PICTURE_CODED = 0x08,62DIRAC_PCODE_PICTURE_RAW = 0x48,63DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8,64DIRAC_PCODE_PICTURE_HQ = 0xE8,65DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A,66DIRAC_PCODE_INTER_NOREF_CO2 = 0x09,67DIRAC_PCODE_INTER_REF_CO1 = 0x0D,68DIRAC_PCODE_INTER_REF_CO2 = 0x0E,69DIRAC_PCODE_INTRA_REF_CO = 0x0C,70DIRAC_PCODE_INTRA_REF_RAW = 0x4C,71DIRAC_PCODE_INTRA_REF_PICT = 0xCC,72DIRAC_PCODE_MAGIC = 0x42424344,73};7475typedef struct DiracVersionInfo {76int major;77int minor;78} DiracVersionInfo;7980typedef struct AVDiracSeqHeader {81unsigned width;82unsigned height;83uint8_t chroma_format; ///< 0: 444 1: 422 2: 4208485uint8_t interlaced;86uint8_t top_field_first;8788uint8_t frame_rate_index; ///< index into dirac_frame_rate[]89uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[]9091uint16_t clean_width;92uint16_t clean_height;93uint16_t clean_left_offset;94uint16_t clean_right_offset;9596uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[]97uint8_t color_spec_index; ///< index into dirac_color_spec_presets[]9899int profile;100int level;101102AVRational framerate;103AVRational sample_aspect_ratio;104105enum AVPixelFormat pix_fmt;106enum AVColorRange color_range;107enum AVColorPrimaries color_primaries;108enum AVColorTransferCharacteristic color_trc;109enum AVColorSpace colorspace;110111DiracVersionInfo version;112int bit_depth;113} AVDiracSeqHeader;114115/**116* Parse a Dirac sequence header.117*118* @param dsh this function will allocate and fill an AVDiracSeqHeader struct119* and write it into this pointer. The caller must free it with120* av_free().121* @param buf the data buffer122* @param buf_size the size of the data buffer in bytes123* @param log_ctx if non-NULL, this function will log errors here124* @return 0 on success, a negative AVERROR code on failure125*/126int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh,127const uint8_t *buf, size_t buf_size,128void *log_ctx);129130#endif /* AVCODEC_DIRAC_H */131132133