FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/cbs_vp9_syntax_template.c
Date: 2024-04-25 05:10:44
Exec Total Coverage
Lines: 204 225 90.7%
Functions: 26 26 100.0%
Branches: 175 308 56.8%

Line Branch Exec Source
1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 56 static int FUNC(frame_sync_code)(CodedBitstreamContext *ctx, RWContext *rw,
20 VP9RawFrameHeader *current)
21 {
22 int err;
23
24
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 fixed(8, frame_sync_byte_0, VP9_FRAME_SYNC_0);
25
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 fixed(8, frame_sync_byte_1, VP9_FRAME_SYNC_1);
26
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 fixed(8, frame_sync_byte_2, VP9_FRAME_SYNC_2);
27
28 56 return 0;
29 }
30
31 56 static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
32 VP9RawFrameHeader *current, int profile)
33 {
34 56 CodedBitstreamVP9Context *vp9 = ctx->priv_data;
35 int err;
36
37
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 22 times.
56 if (profile >= 2) {
38
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
12 f(1, ten_or_twelve_bit);
39
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 4 times.
12 vp9->bit_depth = current->ten_or_twelve_bit ? 12 : 10;
40 } else
41 44 vp9->bit_depth = 8;
42
43
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 f(3, color_space);
44
45
1/2
✓ Branch 0 taken 28 times.
✗ Branch 1 not taken.
56 if (current->color_space != VP9_CS_RGB) {
46
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 f(1, color_range);
47
4/4
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 4 times.
✓ Branch 3 taken 20 times.
56 if (profile == 1 || profile == 3) {
48
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
16 f(1, subsampling_x);
49
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
16 f(1, subsampling_y);
50
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
16 fixed(1, reserved_zero, 0);
51 } else {
52
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
40 infer(subsampling_x, 1);
53
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
40 infer(subsampling_y, 1);
54 }
55 } else {
56 infer(color_range, 1);
57 if (profile == 1 || profile == 3) {
58 infer(subsampling_x, 0);
59 infer(subsampling_y, 0);
60 fixed(1, reserved_zero, 0);
61 }
62 }
63
64 56 vp9->subsampling_x = current->subsampling_x;
65 56 vp9->subsampling_y = current->subsampling_y;
66
67 56 return 0;
68 }
69
70 60 static int FUNC(frame_size)(CodedBitstreamContext *ctx, RWContext *rw,
71 VP9RawFrameHeader *current)
72 {
73 60 CodedBitstreamVP9Context *vp9 = ctx->priv_data;
74 int err;
75
76
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 30 times.
60 f(16, frame_width_minus_1);
77
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 30 times.
60 f(16, frame_height_minus_1);
78
79 60 vp9->frame_width = current->frame_width_minus_1 + 1;
80 60 vp9->frame_height = current->frame_height_minus_1 + 1;
81
82 60 vp9->mi_cols = (vp9->frame_width + 7) >> 3;
83 60 vp9->mi_rows = (vp9->frame_height + 7) >> 3;
84 60 vp9->sb64_cols = (vp9->mi_cols + 7) >> 3;
85 60 vp9->sb64_rows = (vp9->mi_rows + 7) >> 3;
86
87 60 return 0;
88 }
89
90 724 static int FUNC(render_size)(CodedBitstreamContext *ctx, RWContext *rw,
91 VP9RawFrameHeader *current)
92 {
93 int err;
94
95
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, render_and_frame_size_different);
96
97
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 356 times.
724 if (current->render_and_frame_size_different) {
98
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
12 f(16, render_width_minus_1);
99
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
12 f(16, render_height_minus_1);
100 }
101
102 724 return 0;
103 }
104
105 668 static int FUNC(frame_size_with_refs)(CodedBitstreamContext *ctx, RWContext *rw,
106 VP9RawFrameHeader *current)
107 {
108 668 CodedBitstreamVP9Context *vp9 = ctx->priv_data;
109 int err, i;
110
111
2/2
✓ Branch 0 taken 340 times.
✓ Branch 1 taken 2 times.
684 for (i = 0; i < VP9_REFS_PER_FRAME; i++) {
112
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 340 times.
680 fs(1, found_ref[i], 1, i);
113
2/2
✓ Branch 0 taken 332 times.
✓ Branch 1 taken 8 times.
680 if (current->found_ref[i]) {
114 664 VP9ReferenceFrameState *ref =
115 664 &vp9->ref[current->ref_frame_idx[i]];
116
117 664 vp9->frame_width = ref->frame_width;
118 664 vp9->frame_height = ref->frame_height;
119
120 664 vp9->subsampling_x = ref->subsampling_x;
121 664 vp9->subsampling_y = ref->subsampling_y;
122 664 vp9->bit_depth = ref->bit_depth;
123
124 664 break;
125 }
126 }
127
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 332 times.
668 if (i >= VP9_REFS_PER_FRAME)
128
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
4 CHECK(FUNC(frame_size)(ctx, rw, current));
129 else {
130 664 vp9->mi_cols = (vp9->frame_width + 7) >> 3;
131 664 vp9->mi_rows = (vp9->frame_height + 7) >> 3;
132 664 vp9->sb64_cols = (vp9->mi_cols + 7) >> 3;
133 664 vp9->sb64_rows = (vp9->mi_rows + 7) >> 3;
134 }
135
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 CHECK(FUNC(render_size)(ctx, rw, current));
136
137 668 return 0;
138 }
139
140 668 static int FUNC(interpolation_filter)(CodedBitstreamContext *ctx, RWContext *rw,
141 VP9RawFrameHeader *current)
142 {
143 int err;
144
145
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 f(1, is_filter_switchable);
146
2/2
✓ Branch 0 taken 160 times.
✓ Branch 1 taken 174 times.
668 if (!current->is_filter_switchable)
147
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 160 times.
320 f(2, raw_interpolation_filter_type);
148
149 668 return 0;
150 }
151
152 724 static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
153 VP9RawFrameHeader *current)
154 {
155 int err, i;
156
157
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(6, loop_filter_level);
158
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(3, loop_filter_sharpness);
159
160
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, loop_filter_delta_enabled);
161
2/2
✓ Branch 0 taken 332 times.
✓ Branch 1 taken 30 times.
724 if (current->loop_filter_delta_enabled) {
162
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 332 times.
664 f(1, loop_filter_delta_update);
163
2/2
✓ Branch 0 taken 56 times.
✓ Branch 1 taken 276 times.
664 if (current->loop_filter_delta_update) {
164
2/2
✓ Branch 0 taken 224 times.
✓ Branch 1 taken 56 times.
560 for (i = 0; i < VP9_MAX_REF_FRAMES; i++) {
165
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 224 times.
448 fs(1, update_ref_delta[i], 1, i);
166
2/2
✓ Branch 0 taken 90 times.
✓ Branch 1 taken 134 times.
448 if (current->update_ref_delta[i])
167
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 90 times.
180 ss(6, loop_filter_ref_deltas[i], 1, i);
168 }
169
2/2
✓ Branch 0 taken 112 times.
✓ Branch 1 taken 56 times.
336 for (i = 0; i < 2; i++) {
170
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 112 times.
224 fs(1, update_mode_delta[i], 1, i);
171
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 108 times.
224 if (current->update_mode_delta[i])
172
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
8 ss(6, loop_filter_mode_deltas[i], 1, i);
173 }
174 }
175 }
176
177 724 return 0;
178 }
179
180 724 static int FUNC(quantization_params)(CodedBitstreamContext *ctx, RWContext *rw,
181 VP9RawFrameHeader *current)
182 {
183 int err;
184
185
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(8, base_q_idx);
186
187
4/6
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 360 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
724 delta_q(delta_q_y_dc);
188
4/6
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 360 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
724 delta_q(delta_q_uv_dc);
189
4/6
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 360 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
724 delta_q(delta_q_uv_ac);
190
191 724 return 0;
192 }
193
194 724 static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
195 VP9RawFrameHeader *current)
196 {
197 static const uint8_t segmentation_feature_bits[VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
198 static const uint8_t segmentation_feature_signed[VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
199
200 int err, i, j;
201
202
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, segmentation_enabled);
203
204
2/2
✓ Branch 0 taken 86 times.
✓ Branch 1 taken 276 times.
724 if (current->segmentation_enabled) {
205
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 86 times.
172 f(1, segmentation_update_map);
206
2/2
✓ Branch 0 taken 54 times.
✓ Branch 1 taken 32 times.
172 if (current->segmentation_update_map) {
207
2/2
✓ Branch 0 taken 378 times.
✓ Branch 1 taken 54 times.
864 for (i = 0; i < 7; i++)
208
4/6
✗ Branch 1 not taken.
✓ Branch 2 taken 378 times.
✓ Branch 3 taken 270 times.
✓ Branch 4 taken 108 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 270 times.
756 prob(segmentation_tree_probs[i], 1, i);
209
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 54 times.
108 f(1, segmentation_temporal_update);
210
2/2
✓ Branch 0 taken 162 times.
✓ Branch 1 taken 54 times.
432 for (i = 0; i < 3; i++) {
211
2/2
✓ Branch 0 taken 156 times.
✓ Branch 1 taken 6 times.
324 if (current->segmentation_temporal_update)
212
3/6
✗ Branch 1 not taken.
✓ Branch 2 taken 156 times.
✓ Branch 3 taken 156 times.
✗ Branch 4 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 156 times.
312 prob(segmentation_pred_prob[i], 1, i);
213 else
214
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
12 infer(segmentation_pred_prob[i], 255);
215 }
216 }
217
218
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 86 times.
172 f(1, segmentation_update_data);
219
2/2
✓ Branch 0 taken 58 times.
✓ Branch 1 taken 28 times.
172 if (current->segmentation_update_data) {
220
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 58 times.
116 f(1, segmentation_abs_or_delta_update);
221
2/2
✓ Branch 0 taken 464 times.
✓ Branch 1 taken 58 times.
1044 for (i = 0; i < VP9_MAX_SEGMENTS; i++) {
222
2/2
✓ Branch 0 taken 1856 times.
✓ Branch 1 taken 464 times.
4640 for (j = 0; j < VP9_SEG_LVL_MAX; j++) {
223
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1856 times.
3712 fs(1, feature_enabled[i][j], 2, i, j);
224
2/2
✓ Branch 0 taken 336 times.
✓ Branch 1 taken 1520 times.
3712 if (current->feature_enabled[i][j] &&
225
2/2
✓ Branch 0 taken 330 times.
✓ Branch 1 taken 6 times.
672 segmentation_feature_bits[j]) {
226
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 330 times.
660 fs(segmentation_feature_bits[j],
227 feature_value[i][j], 2, i, j);
228
2/2
✓ Branch 0 taken 324 times.
✓ Branch 1 taken 6 times.
660 if (segmentation_feature_signed[j])
229
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 324 times.
648 fs(1, feature_sign[i][j], 2, i, j);
230 else
231
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
12 infer(feature_sign[i][j], 0);
232 } else {
233
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 763 times.
3052 infer(feature_value[i][j], 0);
234
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 763 times.
3052 infer(feature_sign[i][j], 0);
235 }
236 }
237 }
238 }
239 }
240
241 724 return 0;
242 }
243
244 724 static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
245 VP9RawFrameHeader *current)
246 {
247 724 CodedBitstreamVP9Context *vp9 = ctx->priv_data;
248 int min_log2_tile_cols, max_log2_tile_cols;
249 int err;
250
251 724 min_log2_tile_cols = 0;
252
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 362 times.
724 while ((VP9_MAX_TILE_WIDTH_B64 << min_log2_tile_cols) < vp9->sb64_cols)
253 ++min_log2_tile_cols;
254 724 max_log2_tile_cols = 0;
255
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 362 times.
740 while ((vp9->sb64_cols >> (max_log2_tile_cols + 1)) >= VP9_MIN_TILE_WIDTH_B64)
256 16 ++max_log2_tile_cols;
257
258
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 increment(tile_cols_log2, min_log2_tile_cols, max_log2_tile_cols);
259
260
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 increment(tile_rows_log2, 0, 2);
261
262 724 return 0;
263 }
264
265 788 static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
266 VP9RawFrameHeader *current)
267 {
268 788 CodedBitstreamVP9Context *vp9 = ctx->priv_data;
269 int err, i;
270
271
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 394 times.
788 f(2, frame_marker);
272
273
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 394 times.
788 f(1, profile_low_bit);
274
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 394 times.
788 f(1, profile_high_bit);
275 788 vp9->profile = (current->profile_high_bit << 1) + current->profile_low_bit;
276
2/2
✓ Branch 0 taken 44 times.
✓ Branch 1 taken 350 times.
788 if (vp9->profile == 3)
277
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 44 times.
88 fixed(1, reserved_zero, 0);
278
279
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 394 times.
788 f(1, show_existing_frame);
280
2/2
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 362 times.
788 if (current->show_existing_frame) {
281
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 32 times.
64 f(3, frame_to_show_map_idx);
282
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
64 infer(header_size_in_bytes, 0);
283
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
64 infer(refresh_frame_flags, 0x00);
284
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
64 infer(loop_filter_level, 0);
285 64 return 0;
286 }
287
288
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, frame_type);
289
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, show_frame);
290
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, error_resilient_mode);
291
292
2/2
✓ Branch 0 taken 28 times.
✓ Branch 1 taken 334 times.
724 if (current->frame_type == VP9_KEY_FRAME) {
293
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 CHECK(FUNC(frame_sync_code)(ctx, rw, current));
294
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile));
295
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 CHECK(FUNC(frame_size)(ctx, rw, current));
296
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 CHECK(FUNC(render_size)(ctx, rw, current));
297
298
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 14 times.
56 infer(refresh_frame_flags, 0xff);
299
300 } else {
301
2/2
✓ Branch 0 taken 28 times.
✓ Branch 1 taken 306 times.
668 if (current->show_frame == 0)
302
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28 times.
56 f(1, intra_only);
303 else
304
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 153 times.
612 infer(intra_only, 0);
305
306
1/2
✓ Branch 0 taken 334 times.
✗ Branch 1 not taken.
668 if (current->error_resilient_mode == 0)
307
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 f(2, reset_frame_context);
308 else
309 infer(reset_frame_context, 0);
310
311
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 334 times.
668 if (current->intra_only == 1) {
312 CHECK(FUNC(frame_sync_code)(ctx, rw, current));
313
314 if (vp9->profile > 0) {
315 CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile));
316 } else {
317 infer(color_space, 1);
318 infer(subsampling_x, 1);
319 infer(subsampling_y, 1);
320 vp9->bit_depth = 8;
321
322 vp9->subsampling_x = current->subsampling_x;
323 vp9->subsampling_y = current->subsampling_y;
324 }
325
326 f(8, refresh_frame_flags);
327
328 CHECK(FUNC(frame_size)(ctx, rw, current));
329 CHECK(FUNC(render_size)(ctx, rw, current));
330 } else {
331
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 f(8, refresh_frame_flags);
332
333
2/2
✓ Branch 0 taken 1002 times.
✓ Branch 1 taken 334 times.
2672 for (i = 0; i < VP9_REFS_PER_FRAME; i++) {
334
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1002 times.
2004 fs(3, ref_frame_idx[i], 1, i);
335
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1002 times.
2004 fs(1, ref_frame_sign_bias[VP9_LAST_FRAME + i],
336 1, VP9_LAST_FRAME + i);
337 }
338
339
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 CHECK(FUNC(frame_size_with_refs)(ctx, rw, current));
340
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 f(1, allow_high_precision_mv);
341
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 334 times.
668 CHECK(FUNC(interpolation_filter)(ctx, rw, current));
342 }
343 }
344
345
1/2
✓ Branch 0 taken 362 times.
✗ Branch 1 not taken.
724 if (current->error_resilient_mode == 0) {
346
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, refresh_frame_context);
347
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(1, frame_parallel_decoding_mode);
348 } else {
349 infer(refresh_frame_context, 0);
350 infer(frame_parallel_decoding_mode, 1);
351 }
352
353
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(2, frame_context_idx);
354
355
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 CHECK(FUNC(loop_filter_params)(ctx, rw, current));
356
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 CHECK(FUNC(quantization_params)(ctx, rw, current));
357
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 CHECK(FUNC(segmentation_params)(ctx, rw, current));
358
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 CHECK(FUNC(tile_info)(ctx, rw, current));
359
360
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 362 times.
724 f(16, header_size_in_bytes);
361
362
2/2
✓ Branch 0 taken 2896 times.
✓ Branch 1 taken 362 times.
6516 for (i = 0; i < VP9_NUM_REF_FRAMES; i++) {
363
2/2
✓ Branch 0 taken 576 times.
✓ Branch 1 taken 2320 times.
5792 if (current->refresh_frame_flags & (1 << i)) {
364 1152 vp9->ref[i] = (VP9ReferenceFrameState) {
365 1152 .frame_width = vp9->frame_width,
366 1152 .frame_height = vp9->frame_height,
367 1152 .subsampling_x = vp9->subsampling_x,
368 1152 .subsampling_y = vp9->subsampling_y,
369 1152 .bit_depth = vp9->bit_depth,
370 };
371 }
372 }
373
374 724 av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame: size %dx%d "
375 "subsample %dx%d bit_depth %d tiles %dx%d.\n",
376 vp9->frame_width, vp9->frame_height,
377 724 vp9->subsampling_x, vp9->subsampling_y,
378 724 vp9->bit_depth, 1 << current->tile_cols_log2,
379 724 1 << current->tile_rows_log2);
380
381 724 return 0;
382 }
383
384 788 static int FUNC(trailing_bits)(CodedBitstreamContext *ctx, RWContext *rw)
385 {
386 int err;
387
2/2
✓ Branch 1 taken 912 times.
✓ Branch 2 taken 394 times.
2612 while (byte_alignment(rw) != 0)
388
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 912 times.
1824 fixed(1, zero_bit, 0);
389
390 788 return 0;
391 }
392
393 788 static int FUNC(frame)(CodedBitstreamContext *ctx, RWContext *rw,
394 VP9RawFrame *current)
395 {
396 int err;
397
398 788 HEADER("Frame");
399
400
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 394 times.
788 CHECK(FUNC(uncompressed_header)(ctx, rw, &current->header));
401
402
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 394 times.
788 CHECK(FUNC(trailing_bits)(ctx, rw));
403
404 788 return 0;
405 }
406
407 26 static int FUNC(superframe_index)(CodedBitstreamContext *ctx, RWContext *rw,
408 VP9RawSuperframeIndex *current)
409 {
410 int err, i;
411
412 26 HEADER("Superframe Index");
413
414 26 f(3, superframe_marker);
415 26 f(2, bytes_per_framesize_minus_1);
416 26 f(3, frames_in_superframe_minus_1);
417
418 80 for (i = 0; i <= current->frames_in_superframe_minus_1; i++) {
419 // Surprise little-endian!
420 54 fle(8 * (current->bytes_per_framesize_minus_1 + 1),
421 frame_sizes[i], 1, i);
422 }
423
424 26 f(3, superframe_marker);
425 26 f(2, bytes_per_framesize_minus_1);
426 26 f(3, frames_in_superframe_minus_1);
427
428 26 return 0;
429 }
430