diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-10-14 09:51:54 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-15 13:02:20 +0200 |
commit | b95f241b6e6360eef8073b4c7b55bd0e3eb73aca (patch) | |
tree | cba765f68afaa7f2faf2be07c1ccddefdb721958 /libavcodec/vp9.h | |
parent | f2f55bd9ca45001dea0d80c137fa93d1b9b7d01c (diff) | |
download | ffmpeg-b95f241b6e6360eef8073b4c7b55bd0e3eb73aca.tar.gz |
vp9: split header into separate struct and expose in vp9.h
This allows hwaccels to access the bitstream header information.
Diffstat (limited to 'libavcodec/vp9.h')
-rw-r--r-- | libavcodec/vp9.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/libavcodec/vp9.h b/libavcodec/vp9.h index 9a29416e8d..cac15f4aab 100644 --- a/libavcodec/vp9.h +++ b/libavcodec/vp9.h @@ -24,6 +24,39 @@ #ifndef AVCODEC_VP9_H #define AVCODEC_VP9_H +#include <stdint.h> + +enum BlockLevel { + BL_64X64, + BL_32X32, + BL_16X16, + BL_8X8, +}; + +enum BlockPartition { + PARTITION_NONE, // [ ] <-. + PARTITION_H, // [-] | + PARTITION_V, // [|] | + PARTITION_SPLIT, // [+] --' +}; + +enum BlockSize { + BS_64x64, + BS_64x32, + BS_32x64, + BS_32x32, + BS_32x16, + BS_16x32, + BS_16x16, + BS_16x8, + BS_8x16, + BS_8x8, + BS_8x4, + BS_4x8, + BS_4x4, + N_BS_SIZES, +}; + enum TxfmMode { TX_4X4, TX_8X8, @@ -61,6 +94,13 @@ enum IntraPredMode { N_INTRA_PRED_MODES }; +enum InterPredMode { + NEARESTMV = 10, + NEARMV = 11, + ZEROMV = 12, + NEWMV = 13, +}; + enum FilterMode { FILTER_8TAP_SMOOTH, FILTER_8TAP_REGULAR, @@ -69,4 +109,78 @@ enum FilterMode { FILTER_SWITCHABLE, }; +enum CompPredMode { + PRED_SINGLEREF, + PRED_COMPREF, + PRED_SWITCHABLE, +}; + +typedef struct VP9BitstreamHeader { + // bitstream header + uint8_t profile; + uint8_t keyframe; + uint8_t invisible; + uint8_t errorres; + uint8_t intraonly; + uint8_t resetctx; + uint8_t refreshrefmask; + uint8_t highprecisionmvs; + enum FilterMode filtermode; + uint8_t allowcompinter; + uint8_t refreshctx; + uint8_t parallelmode; + uint8_t framectxid; + uint8_t use_last_frame_mvs; + uint8_t refidx[3]; + uint8_t signbias[3]; + uint8_t fixcompref; + uint8_t varcompref[2]; + struct { + uint8_t level; + int8_t sharpness; + } filter; + struct { + uint8_t enabled; + uint8_t updated; + int8_t mode[2]; + int8_t ref[4]; + } lf_delta; + uint8_t yac_qi; + int8_t ydc_qdelta, uvdc_qdelta, uvac_qdelta; + uint8_t lossless; +#define MAX_SEGMENT 8 + struct { + uint8_t enabled; + uint8_t temporal; + uint8_t absolute_vals; + uint8_t update_map; + uint8_t prob[7]; + uint8_t pred_prob[3]; + struct { + uint8_t q_enabled; + uint8_t lf_enabled; + uint8_t ref_enabled; + uint8_t skip_enabled; + uint8_t ref_val; + int16_t q_val; + int8_t lf_val; + int16_t qmul[2][2]; + uint8_t lflvl[4][2]; + } feat[MAX_SEGMENT]; + } segmentation; + enum TxfmMode txfmmode; + enum CompPredMode comppredmode; + struct { + unsigned log2_tile_cols, log2_tile_rows; + unsigned tile_cols, tile_rows; + } tiling; + + int uncompressed_header_size; + int compressed_header_size; +} VP9BitstreamHeader; + +typedef struct VP9SharedContext { + VP9BitstreamHeader h; +} VP9SharedContext; + #endif /* AVCODEC_VP9_H */ |