27 xf(8, frame_sync_byte_0, frame_sync_byte_0, 0);
28 xf(8, frame_sync_byte_1, frame_sync_byte_1, 0);
29 xf(8, frame_sync_byte_2, frame_sync_byte_2, 0);
35 "%02x %02x %02x.\n", frame_sync_byte_0,
36 frame_sync_byte_1, frame_sync_byte_2);
50 f(1, ten_or_twelve_bit);
51 vp9->
bit_depth = current->ten_or_twelve_bit ? 12 : 10;
62 fixed(1, reserved_zero, 0);
64 infer(subsampling_x, 1);
65 infer(subsampling_y, 1);
70 infer(subsampling_x, 0);
71 infer(subsampling_y, 0);
72 fixed(1, reserved_zero, 0);
88 f(16, frame_width_minus_1);
89 f(16, frame_height_minus_1);
91 vp9->
frame_width = current->frame_width_minus_1 + 1;
107 f(1, render_and_frame_size_different);
109 if (current->render_and_frame_size_different) {
110 f(16, render_width_minus_1);
111 f(16, render_height_minus_1);
124 fs(1, found_ref[i], 1, i);
125 if (current->found_ref[i]) {
127 &vp9->
ref[current->ref_frame_idx[i]];
139 if (i >= VP9_REFS_PER_FRAME)
157 f(1, is_filter_switchable);
158 if (!current->is_filter_switchable)
159 f(2, raw_interpolation_filter_type);
169 f(6, loop_filter_level);
170 f(3, loop_filter_sharpness);
172 f(1, loop_filter_delta_enabled);
173 if (current->loop_filter_delta_enabled) {
174 f(1, loop_filter_delta_update);
175 if (current->loop_filter_delta_update) {
177 fs(1, update_ref_delta[i], 1, i);
178 if (current->update_ref_delta[i])
179 ss(6, loop_filter_ref_deltas[i], 1, i);
181 for (i = 0; i < 2; i++) {
182 fs(1, update_mode_delta[i], 1, i);
183 if (current->update_mode_delta[i])
184 ss(6, loop_filter_mode_deltas[i], 1, i);
209 static const int segmentation_feature_bits[
VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
210 static const int segmentation_feature_signed[
VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
214 f(1, segmentation_enabled);
216 if (current->segmentation_enabled) {
217 f(1, segmentation_update_map);
218 if (current->segmentation_update_map) {
219 for (i = 0; i < 7; i++)
220 prob(segmentation_tree_probs[i], 1, i);
221 f(1, segmentation_temporal_update);
222 for (i = 0; i < 3; i++) {
223 if (current->segmentation_temporal_update)
224 prob(segmentation_pred_prob[i], 1, i);
226 infer(segmentation_pred_prob[i], 255);
230 f(1, segmentation_update_data);
231 if (current->segmentation_update_data) {
232 f(1, segmentation_abs_or_delta_update);
235 fs(1, feature_enabled[i][j], 2, i, j);
236 if (current->feature_enabled[i][j] &&
237 segmentation_feature_bits[j]) {
238 fs(segmentation_feature_bits[j],
239 feature_value[i][j], 2, i, j);
240 if (segmentation_feature_signed[j])
241 fs(1, feature_sign[i][j], 2, i, j);
243 infer(feature_sign[i][j], 0);
245 infer(feature_value[i][j], 0);
246 infer(feature_sign[i][j], 0);
260 int min_log2_tile_cols, max_log2_tile_cols;
263 min_log2_tile_cols = 0;
265 ++min_log2_tile_cols;
266 max_log2_tile_cols = 0;
268 ++max_log2_tile_cols;
270 increment(tile_cols_log2, min_log2_tile_cols, max_log2_tile_cols);
285 f(1, profile_low_bit);
286 f(1, profile_high_bit);
287 vp9->
profile = (current->profile_high_bit << 1) + current->profile_low_bit;
289 fixed(1, reserved_zero, 0);
291 f(1, show_existing_frame);
292 if (current->show_existing_frame) {
293 f(3, frame_to_show_map_idx);
294 infer(header_size_in_bytes, 0);
295 infer(refresh_frame_flags, 0x00);
296 infer(loop_filter_level, 0);
302 f(1, error_resilient_mode);
310 infer(refresh_frame_flags, 0xff);
313 if (current->show_frame == 0)
318 if (current->error_resilient_mode == 0)
319 f(2, reset_frame_context);
321 infer(reset_frame_context, 0);
323 if (current->intra_only == 1) {
329 infer(color_space, 1);
330 infer(subsampling_x, 1);
331 infer(subsampling_y, 1);
338 f(8, refresh_frame_flags);
343 f(8, refresh_frame_flags);
346 fs(3, ref_frame_idx[i], 1, i);
352 f(1, allow_high_precision_mv);
357 if (current->error_resilient_mode == 0) {
358 f(1, refresh_frame_context);
359 f(1, frame_parallel_decoding_mode);
361 infer(refresh_frame_context, 0);
362 infer(frame_parallel_decoding_mode, 1);
365 f(2, frame_context_idx);
372 f(16, header_size_in_bytes);
375 if (current->refresh_frame_flags & (1 << i)) {
387 "subsample %dx%d bit_depth %d tiles %dx%d.\n",
390 vp9->
bit_depth, 1 << current->tile_cols_log2,
391 1 << current->tile_rows_log2);
401 xf(1, zero_bit, zero, 0);
425 HEADER(
"Superframe Index");
427 f(3, superframe_marker);
428 f(2, bytes_per_framesize_minus_1);
429 f(3, frames_in_superframe_minus_1);
431 for (i = 0; i <= current->frames_in_superframe_minus_1; i++) {
433 fle(8 * (current->bytes_per_framesize_minus_1 + 1),
437 f(3, superframe_marker);
438 f(2, bytes_per_framesize_minus_1);
439 f(3, frames_in_superframe_minus_1);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define fixed(width, name, value)
static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
#define fle(width, name, subs,...)
static const uint8_t frame_sizes[]
static int FUNC() superframe_index(CodedBitstreamContext *ctx, RWContext *rw, VP9RawSuperframeIndex *current)
#define fs(width, name, subs,...)
#define byte_alignment(rw)
static int FUNC() render_size(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
CHECK(-1) CHECK(-2)}}}}CHECK(1) CHECK(2)}}}}}if(diff0+diff1 > 0) temp-
static int FUNC() frame_sync_code(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
static int FUNC() loop_filter_params(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
#define prob(name, subs,...)
static int FUNC() segmentation_params(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int FUNC() frame_size_with_refs(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
#define ss(width, name, subs,...)
VP9ReferenceFrameState ref[VP9_NUM_REF_FRAMES]
#define increment(name, min, max)
static int FUNC() color_config(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current, int profile)
static int FUNC() quantization_params(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
static int FUNC() uncompressed_header(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
Context structure for coded bitstream operations.
static int FUNC() frame_size(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
static int FUNC() interpolation_filter(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)
static int ref[MAX_W *MAX_W]
#define xf(width, name, var, range_min, range_max, subs,...)
static int FUNC() trailing_bits(CodedBitstreamContext *ctx, RWContext *rw)
void * priv_data
Format private data.
static int FUNC() frame(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrame *current)
#define infer(name, value)
static int FUNC() tile_info(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current)