38 f(1, ten_or_twelve_bit);
50 fixed(1, reserved_zero, 0);
52 infer(subsampling_x, 1);
53 infer(subsampling_y, 1);
58 infer(subsampling_x, 0);
59 infer(subsampling_y, 0);
60 fixed(1, reserved_zero, 0);
76 f(16, frame_width_minus_1);
77 f(16, frame_height_minus_1);
95 f(1, render_and_frame_size_different);
97 if (
current->render_and_frame_size_different) {
98 f(16, render_width_minus_1);
99 f(16, render_height_minus_1);
112 fs(1, found_ref[
i], 1,
i);
145 f(1, is_filter_switchable);
146 if (!
current->is_filter_switchable)
147 f(2, raw_interpolation_filter_type);
157 f(6, loop_filter_level);
158 f(3, loop_filter_sharpness);
160 f(1, loop_filter_delta_enabled);
161 if (
current->loop_filter_delta_enabled) {
162 f(1, loop_filter_delta_update);
163 if (
current->loop_filter_delta_update) {
165 fs(1, update_ref_delta[
i], 1,
i);
167 ss(6, loop_filter_ref_deltas[
i], 1,
i);
169 for (
i = 0;
i < 2;
i++) {
170 fs(1, update_mode_delta[
i], 1,
i);
172 ss(6, loop_filter_mode_deltas[
i], 1,
i);
176 infer(loop_filter_delta_update, 0);
199 static const uint8_t segmentation_feature_bits[
VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
200 static const uint8_t segmentation_feature_signed[
VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
203 f(1, segmentation_enabled);
205 if (
current->segmentation_enabled) {
206 f(1, segmentation_update_map);
207 if (
current->segmentation_update_map) {
208 for (
i = 0;
i < 7;
i++)
209 prob(segmentation_tree_probs[
i], 1,
i);
210 f(1, segmentation_temporal_update);
211 for (
i = 0;
i < 3;
i++) {
212 if (
current->segmentation_temporal_update)
213 prob(segmentation_pred_prob[
i], 1,
i);
215 infer(segmentation_pred_prob[
i], 255);
219 f(1, segmentation_update_data);
220 if (
current->segmentation_update_data) {
221 f(1, segmentation_abs_or_delta_update);
224 fs(1, feature_enabled[
i][j], 2,
i, j);
225 if (
current->feature_enabled[
i][j] &&
226 segmentation_feature_bits[j]) {
227 fs(segmentation_feature_bits[j],
228 feature_value[
i][j], 2,
i, j);
229 if (segmentation_feature_signed[j])
230 fs(1, feature_sign[
i][j], 2,
i, j);
232 infer(feature_sign[
i][j], 0);
234 infer(feature_value[
i][j], 0);
235 infer(feature_sign[
i][j], 0);
241 infer(segmentation_update_data, 0);
251 int min_log2_tile_cols, max_log2_tile_cols;
254 min_log2_tile_cols = 0;
256 ++min_log2_tile_cols;
257 max_log2_tile_cols = 0;
259 ++max_log2_tile_cols;
261 increment(tile_cols_log2, min_log2_tile_cols, max_log2_tile_cols);
276 f(1, profile_low_bit);
277 f(1, profile_high_bit);
280 fixed(1, reserved_zero, 0);
282 f(1, show_existing_frame);
283 if (
current->show_existing_frame) {
284 f(3, frame_to_show_map_idx);
285 infer(header_size_in_bytes, 0);
286 infer(refresh_frame_flags, 0x00);
287 infer(loop_filter_level, 0);
293 f(1, error_resilient_mode);
301 infer(refresh_frame_flags, 0xff);
309 if (
current->error_resilient_mode == 0)
310 f(2, reset_frame_context);
312 infer(reset_frame_context, 0);
314 if (
current->intra_only == 1) {
320 infer(color_space, 1);
321 infer(subsampling_x, 1);
322 infer(subsampling_y, 1);
329 f(8, refresh_frame_flags);
334 f(8, refresh_frame_flags);
337 fs(3, ref_frame_idx[
i], 1,
i);
343 f(1, allow_high_precision_mv);
348 if (
current->error_resilient_mode == 0) {
349 f(1, refresh_frame_context);
350 f(1, frame_parallel_decoding_mode);
352 infer(refresh_frame_context, 0);
353 infer(frame_parallel_decoding_mode, 1);
356 f(2, frame_context_idx);
363 f(16, header_size_in_bytes);
366 if (
current->refresh_frame_flags & (1 <<
i)) {
381 current->error_resilient_mode) {
398 if (
current->loop_filter_delta_update) {
399 for (
i = 0;
i < 4;
i++) {
404 for (
i = 0;
i < 2;
i++) {
407 current->loop_filter_mode_deltas[
i];
411 if (
current->segmentation_update_data) {
419 if (
current->segmentation_update_map) {
421 current->segmentation_tree_probs,
424 current->segmentation_pred_prob,
430 "subsample %dx%d bit_depth %d tiles %dx%d.\n",
443 fixed(1, zero_bit, 0);
467 HEADER(
"Superframe Index");
469 f(3, superframe_marker);
470 f(2, bytes_per_framesize_minus_1);
471 f(3, frames_in_superframe_minus_1);
473 for (
i = 0;
i <=
current->frames_in_superframe_minus_1;
i++) {
475 fle(8 * (
current->bytes_per_framesize_minus_1 + 1),
479 f(3, superframe_marker);
480 f(2, bytes_per_framesize_minus_1);
481 f(3, frames_in_superframe_minus_1);
static int FUNC tile_info(CodedBitstreamContext *ctx, RWContext *rw, APVRawTileInfo *current, const APVRawFrameHeader *fh)
static int FUNC quantization_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC render_size(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC segmentation_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC color_config(CodedBitstreamContext *ctx, RWContext *rw, AV1RawColorConfig *current, int seq_profile)
static int FUNC interpolation_filter(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC frame_size_with_refs(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC loop_filter_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC uncompressed_header(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC trailing_bits(CodedBitstreamContext *ctx, RWContext *rw, int nb_bits)
#define infer(name, value)
#define byte_alignment(rw)
#define i(width, name, range_min, range_max)
#define ss(width, name, subs,...)
#define fle(width, name, subs,...)
#define prob(name, subs,...)
#define fs(width, name, subs,...)
#define increment(name, min, max)
static int FUNC superframe_index(CodedBitstreamContext *ctx, RWContext *rw, VP9RawSuperframeIndex *current)
static int FUNC frame_sync_code(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
static struct @111144215057303131116103221376075045141373005341 current
static void show_frame(AVTextFormatContext *tfc, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
static const uint8_t frame_size[4]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define fixed(width, name, value)
static const uint8_t frame_sizes[]
Context structure for coded bitstream operations.
uint8_t feature_enabled[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
uint8_t feature_value[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
int8_t loop_filter_ref_deltas[VP9_MAX_REF_FRAMES]
VP9ReferenceFrameState ref[VP9_NUM_REF_FRAMES]
uint8_t segmentation_pred_prob[3]
int8_t loop_filter_mode_deltas[2]
uint8_t segmentation_tree_probs[7]
uint8_t feature_sign[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
static int ref[MAX_W *MAX_W]
static AVFormatContext * ctx