| 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 | 186 | static int FUNC(byte_alignment)(CodedBitstreamContext *ctx, RWContext *rw) | |
| 20 | { | ||
| 21 | int err; | ||
| 22 | |||
| 23 | // ISO/IEC 23094-2:2021/FDAM 1:2023(E) 7.3.12 | ||
| 24 |
2/2✓ Branch 1 taken 522 times.
✓ Branch 2 taken 93 times.
|
1230 | while (byte_alignment(rw) != 0) |
| 25 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 522 times.
|
1044 | fixed(1, alignment_bit_equal_to_zero, 0); |
| 26 | |||
| 27 | 186 | return 0; | |
| 28 | } | ||
| 29 | |||
| 30 | 132 | static int FUNC(rbsp_trailing_bits)(CodedBitstreamContext *ctx, RWContext *rw) | |
| 31 | { | ||
| 32 | int err; | ||
| 33 | |||
| 34 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 66 times.
|
132 | fixed(1, rbsp_stop_one_bit, 1); |
| 35 |
2/2✓ Branch 1 taken 462 times.
✓ Branch 2 taken 66 times.
|
1056 | while (byte_alignment(rw) != 0) |
| 36 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 462 times.
|
924 | fixed(1, rbsp_alignment_zero_bit, 0); |
| 37 | |||
| 38 | 132 | return 0; | |
| 39 | } | ||
| 40 | |||
| 41 | 132 | static int FUNC(nal_unit_header)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 42 | LCEVCRawNALUnitHeader *current, | ||
| 43 | uint32_t valid_type_mask) | ||
| 44 | { | ||
| 45 | int err; | ||
| 46 | |||
| 47 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 66 times.
|
132 | fixed(1, forbidden_zero_bit, 0); |
| 48 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 66 times.
|
132 | fixed(1, forbidden_one_bit, 1); |
| 49 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 66 times.
|
132 | ub(5, nal_unit_type); |
| 50 | |||
| 51 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 66 times.
|
132 | if (!(1 << current->nal_unit_type & valid_type_mask)) { |
| 52 | ✗ | av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid NAL unit type %d.\n", | |
| 53 | ✗ | current->nal_unit_type); | |
| 54 | ✗ | return AVERROR_INVALIDDATA; | |
| 55 | } | ||
| 56 | |||
| 57 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 66 times.
|
132 | ub(9, reserved_flag); |
| 58 | |||
| 59 | 132 | return 0; | |
| 60 | } | ||
| 61 | |||
| 62 | 48 | LCEVC_BLOCK_FUNC(global_config, (CodedBitstreamContext *ctx, RWContext *rw, | |
| 63 | LCEVCRawGlobalConfig *current, | ||
| 64 | LCEVCProcessBlockState *state, | ||
| 65 | int nal_unit_type)) | ||
| 66 | { | ||
| 67 | 24 | CodedBitstreamLCEVCContext *priv = ctx->priv_data; | |
| 68 | int err; | ||
| 69 | |||
| 70 | 24 | HEADER("Global Config"); | |
| 71 | |||
| 72 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(processed_planes_type_flag); |
| 73 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(6, resolution_type); |
| 74 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(1, transform_type); |
| 75 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, chroma_sampling_type); |
| 76 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, base_depth_type); |
| 77 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, enhancement_depth_type); |
| 78 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(temporal_step_width_modifier_signalled_flag); |
| 79 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(predicted_residual_mode_flag); |
| 80 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(temporal_tile_intra_signalling_enabled_flag); |
| 81 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(temporal_enabled_flag); |
| 82 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(3, upsample_type); |
| 83 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(level1_filtering_signalled_flag); |
| 84 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, scaling_mode_level1); |
| 85 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, scaling_mode_level2); |
| 86 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, tile_dimensions_type); |
| 87 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, user_data_enabled); |
| 88 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(level1_depth_flag); |
| 89 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(chroma_step_width_flag); |
| 90 | |||
| 91 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->processed_planes_type_flag) { |
| 92 | ✗ | ub(4, planes_type); | |
| 93 | ✗ | ub(4, reserved_zeros_4bit); | |
| 94 | } else | ||
| 95 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
24 | infer(planes_type, 0); |
| 96 | |||
| 97 |
1/2✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
|
24 | if (current->temporal_step_width_modifier_signalled_flag) { |
| 98 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(8, temporal_step_width_modifier); |
| 99 | } | ||
| 100 | |||
| 101 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->upsample_type == 4) { |
| 102 | ✗ | ub(16, upsampler_coeff1); | |
| 103 | ✗ | ub(16, upsampler_coeff2); | |
| 104 | ✗ | ub(16, upsampler_coeff3); | |
| 105 | ✗ | ub(16, upsampler_coeff4); | |
| 106 | } | ||
| 107 | |||
| 108 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->level1_filtering_signalled_flag) { |
| 109 | ✗ | ub(4, level1_filtering_first_coefficient); | |
| 110 | ✗ | ub(4, level1_filtering_second_coefficient); | |
| 111 | } | ||
| 112 | |||
| 113 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->tile_dimensions_type > 0) { |
| 114 | ✗ | if (current->tile_dimensions_type == 3) { | |
| 115 | ✗ | ub(16, custom_tile_width); | |
| 116 | ✗ | ub(16, custom_tile_height); | |
| 117 | } | ||
| 118 | ✗ | ub(5, reserved_zeros_5bit); | |
| 119 | ✗ | flag(compression_type_entropy_enabled_per_tile_flag); | |
| 120 | ✗ | ub(2, compression_type_size_per_tile); | |
| 121 | } | ||
| 122 | |||
| 123 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->resolution_type == 63) { |
| 124 | ✗ | ub(16, custom_resolution_width); | |
| 125 | ✗ | ub(16, custom_resolution_height); | |
| 126 | } | ||
| 127 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->chroma_step_width_flag) { |
| 128 | ✗ | ub(8, chroma_step_width_multiplier); | |
| 129 | } else { | ||
| 130 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
24 | infer(chroma_step_width_multiplier, 64); |
| 131 | } | ||
| 132 | |||
| 133 | 24 | av_refstruct_replace(&priv->gc, current); | |
| 134 | |||
| 135 | 24 | return 0; | |
| 136 | } | ||
| 137 | |||
| 138 | 48 | LCEVC_BLOCK_FUNC(sequence_config, (CodedBitstreamContext *ctx, RWContext *rw, | |
| 139 | LCEVCRawSequenceConfig *current, | ||
| 140 | LCEVCProcessBlockState *state, | ||
| 141 | int nal_unit_type)) | ||
| 142 | { | ||
| 143 | 24 | CodedBitstreamLCEVCContext *priv = ctx->priv_data; | |
| 144 | int err; | ||
| 145 | |||
| 146 | 24 | HEADER("Sequence Config"); | |
| 147 | |||
| 148 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(4, profile_idc); |
| 149 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(4, level_idc); |
| 150 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(2, sublevel_idc); |
| 151 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(conformance_window_flag); |
| 152 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(5, reserved_zeros_5bit); |
| 153 | |||
| 154 |
2/4✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 12 times.
|
24 | if (current->profile_idc == 15 || current->level_idc == 15) { |
| 155 | ✗ | ub(3, profile_idc); | |
| 156 | ✗ | ub(4, level_idc); | |
| 157 | ✗ | ub(1, reserved_zeros_1bit); | |
| 158 | } | ||
| 159 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->conformance_window_flag == 1) { |
| 160 | ✗ | mb(conf_win_left_offset); | |
| 161 | ✗ | mb(conf_win_right_offset); | |
| 162 | ✗ | mb(conf_win_top_offset); | |
| 163 | ✗ | mb(conf_win_bottom_offset); | |
| 164 | } | ||
| 165 | |||
| 166 | 24 | av_refstruct_replace(&priv->sc, current); | |
| 167 | |||
| 168 | 24 | return 0; | |
| 169 | } | ||
| 170 | |||
| 171 | 372 | LCEVC_BLOCK_FUNC(picture_config, (CodedBitstreamContext *ctx, RWContext *rw, | |
| 172 | LCEVCRawPictureConfig *current, | ||
| 173 | LCEVCProcessBlockState *state, | ||
| 174 | int nal_unit_type)) | ||
| 175 | { | ||
| 176 | 186 | CodedBitstreamLCEVCContext *priv = ctx->priv_data; | |
| 177 | int nlayers, err; | ||
| 178 | |||
| 179 | 186 | HEADER("Picture Config"); | |
| 180 | |||
| 181 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 93 times.
|
186 | if (!priv->gc) |
| 182 | ✗ | return AVERROR_INVALIDDATA; | |
| 183 | |||
| 184 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 93 times.
|
186 | flag(no_enhancement_bit_flag); |
| 185 |
2/2✓ Branch 0 taken 81 times.
✓ Branch 1 taken 12 times.
|
186 | if (current->no_enhancement_bit_flag == 0) { |
| 186 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | ub(3, quant_matrix_mode); |
| 187 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | flag(dequant_offset_signalled_flag); |
| 188 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | flag(picture_type_bit_flag); |
| 189 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | flag(temporal_refresh_bit_flag); |
| 190 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | flag(step_width_sublayer1_enabled_flag); |
| 191 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | ub(15, step_width_sublayer2); |
| 192 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
|
162 | flag(dithering_control_flag); |
| 193 | 162 | priv->dithering_control_flag = current->dithering_control_flag; | |
| 194 |
5/10✓ Branch 0 taken 78 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 75 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 54 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
|
162 | infer(temporal_signalling_present_flag, priv->gc->temporal_enabled_flag && |
| 195 | !current->temporal_refresh_bit_flag); | ||
| 196 | } else { | ||
| 197 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
24 | infer(quant_matrix_mode, 0); |
| 198 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
24 | infer(dequant_offset_signalled_flag, 0); |
| 199 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(4, reserved_zeros_4bit); |
| 200 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(picture_type_bit_flag); |
| 201 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(temporal_refresh_bit_flag); |
| 202 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
|
24 | infer(step_width_sublayer1_enabled_flag, 0); |
| 203 |
2/6✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
24 | infer(dithering_control_flag, nal_unit_type == LCEVC_IDR_NUT |
| 204 | ? 0 | ||
| 205 | : priv->dithering_control_flag); | ||
| 206 | 24 | priv->dithering_control_flag = current->dithering_control_flag; | |
| 207 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | flag(temporal_signalling_present_flag); |
| 208 | } | ||
| 209 | |||
| 210 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 93 times.
|
186 | if (current->picture_type_bit_flag == 1) { |
| 211 | ✗ | flag(field_type_bit_flag); | |
| 212 | ✗ | ub(7, reserved_zeros_7bit); | |
| 213 | } | ||
| 214 | |||
| 215 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 90 times.
|
186 | if (current->step_width_sublayer1_enabled_flag == 1) { |
| 216 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
6 | ub(15, step_width_sublayer1); |
| 217 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
|
6 | flag(level1_filtering_enabled_flag); |
| 218 | } else | ||
| 219 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 60 times.
|
180 | infer(level1_filtering_enabled_flag, 0); |
| 220 | |||
| 221 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 93 times.
|
186 | nlayers = priv->gc->transform_type ? 16 : 4; |
| 222 |
2/2✓ Branch 0 taken 90 times.
✓ Branch 1 taken 3 times.
|
186 | if (current->quant_matrix_mode == 2 || |
| 223 |
1/2✓ Branch 0 taken 90 times.
✗ Branch 1 not taken.
|
180 | current->quant_matrix_mode == 3 || |
| 224 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 87 times.
|
180 | current->quant_matrix_mode == 5) { |
| 225 |
2/2✓ Branch 0 taken 24 times.
✓ Branch 1 taken 6 times.
|
60 | for (int layer_idx = 0; layer_idx < nlayers; layer_idx++) |
| 226 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
|
48 | ubs(8, qm_coefficient_0[layer_idx], 1, layer_idx); |
| 227 | } | ||
| 228 | |||
| 229 |
3/4✓ Branch 0 taken 93 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✓ Branch 3 taken 90 times.
|
186 | if (current->quant_matrix_mode == 4 || current->quant_matrix_mode == 5) { |
| 230 |
2/2✓ Branch 0 taken 12 times.
✓ Branch 1 taken 3 times.
|
30 | for (int layer_idx = 0; layer_idx < nlayers; layer_idx++) |
| 231 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ubs(8, qm_coefficient_1[layer_idx], 1, layer_idx); |
| 232 | } | ||
| 233 | |||
| 234 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 15 times.
|
186 | if (current->dequant_offset_signalled_flag) { |
| 235 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | flag(dequant_offset_mode_flag); |
| 236 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | ub(7, dequant_offset); |
| 237 | } | ||
| 238 | |||
| 239 |
2/2✓ Branch 0 taken 90 times.
✓ Branch 1 taken 3 times.
|
186 | if (current->dithering_control_flag == 1) { |
| 240 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 90 times.
|
180 | ub(2, dithering_type); |
| 241 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 90 times.
|
180 | ub(1, reserverd_zero); |
| 242 |
1/2✓ Branch 0 taken 90 times.
✗ Branch 1 not taken.
|
180 | if (current->dithering_type != 0) { |
| 243 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 90 times.
|
180 | ub(5, dithering_strength); |
| 244 | } else { | ||
| 245 | ✗ | ub(5, reserved_zeros_5bit); | |
| 246 | } | ||
| 247 | } | ||
| 248 | |||
| 249 | 186 | av_refstruct_replace(&priv->pc, current); | |
| 250 | 186 | av_refstruct_replace(¤t->gc, priv->gc); | |
| 251 | |||
| 252 | 186 | return 0; | |
| 253 | } | ||
| 254 | |||
| 255 | 372 | LCEVC_BLOCK_FUNC(encoded_data, (CodedBitstreamContext *ctx, RWContext *rw, | |
| 256 | LCEVCRawEncodedData *current, | ||
| 257 | LCEVCProcessBlockState *state, | ||
| 258 | int nal_unit_type)) | ||
| 259 | { | ||
| 260 | 186 | CodedBitstreamLCEVCContext *priv = ctx->priv_data; | |
| 261 | int nplanes, nlayers, err; | ||
| 262 | #ifdef READ | ||
| 263 | 62 | int start = get_bits_count(rw); | |
| 264 | #endif | ||
| 265 | |||
| 266 | 186 | HEADER("Encoded Data"); | |
| 267 | |||
| 268 |
2/4✓ Branch 0 taken 93 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 93 times.
|
186 | if (!priv->gc || !priv->pc) |
| 269 | ✗ | return AVERROR_INVALIDDATA; | |
| 270 | |||
| 271 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 93 times.
|
186 | nplanes = priv->gc->planes_type ? 3 : 1; |
| 272 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 93 times.
|
186 | nlayers = priv->gc->transform_type ? 16 : 4; |
| 273 |
2/2✓ Branch 0 taken 93 times.
✓ Branch 1 taken 93 times.
|
372 | for (int plane_idx = 0; plane_idx < nplanes; plane_idx++) { |
| 274 |
2/2✓ Branch 0 taken 81 times.
✓ Branch 1 taken 12 times.
|
186 | if (priv->pc->no_enhancement_bit_flag == 0) { |
| 275 |
2/2✓ Branch 0 taken 162 times.
✓ Branch 1 taken 81 times.
|
486 | for (int level_idx = 1; level_idx <= 2; level_idx++) { |
| 276 |
2/2✓ Branch 0 taken 648 times.
✓ Branch 1 taken 162 times.
|
1620 | for (int layer_idx = 0; layer_idx < nlayers; layer_idx++) { |
| 277 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 648 times.
|
1296 | ubs(1, surfaces_entropy_enabled_flag[plane_idx][level_idx][layer_idx], 3, plane_idx, level_idx, layer_idx); |
| 278 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 648 times.
|
1296 | ubs(1, surfaces_rle_only_flag[plane_idx][level_idx][layer_idx], 3, plane_idx, level_idx, layer_idx); |
| 279 | } | ||
| 280 | } | ||
| 281 | } | ||
| 282 |
2/2✓ Branch 0 taken 87 times.
✓ Branch 1 taken 6 times.
|
186 | if (priv->pc->temporal_signalling_present_flag == 1) { |
| 283 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 87 times.
|
174 | ubs(1, temporal_surfaces_entropy_enabled_flag[plane_idx], 1, plane_idx); |
| 284 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 87 times.
|
174 | ubs(1, temporal_surfaces_rle_only_flag[plane_idx], 1, plane_idx); |
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 93 times.
|
186 | CHECK(FUNC(byte_alignment)(ctx, rw)); |
| 289 | |||
| 290 | #ifdef READ | ||
| 291 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 31 times.
|
62 | if (!ff_cbs_h2645_read_more_rbsp_data(rw)) |
| 292 | ✗ | return AVERROR_INVALIDDATA; | |
| 293 | |||
| 294 | 62 | int pos = get_bits_count(rw) - start; | |
| 295 | 62 | int len = state->payload_size; | |
| 296 | |||
| 297 | 62 | current->data_offset = get_bits_count(rw) / 8; | |
| 298 | 62 | current->data_size = len - pos / 8; | |
| 299 | 62 | skip_bits_long(rw, current->data_size * 8); | |
| 300 | #else | ||
| 301 | 124 | err = ff_cbs_h2645_write_slice_data(ctx, rw, current->data, | |
| 302 | current->data_size, 0); | ||
| 303 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 62 times.
|
124 | if (err < 0) |
| 304 | ✗ | return err; | |
| 305 | #endif | ||
| 306 | |||
| 307 | 186 | av_refstruct_replace(¤t->sc, priv->sc); | |
| 308 | 186 | av_refstruct_replace(¤t->gc, priv->gc); | |
| 309 | 186 | av_refstruct_replace(¤t->pc, priv->pc); | |
| 310 | |||
| 311 | 186 | return 0; | |
| 312 | } | ||
| 313 | |||
| 314 | 24 | static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 315 | LCEVCRawSEI *current, int payload_size) | ||
| 316 | { | ||
| 317 | 24 | SEIRawMessage *message = ¤t->message; | |
| 318 | int sei_type; | ||
| 319 | int i, err; | ||
| 320 | |||
| 321 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | ub(8, payload_type); |
| 322 | |||
| 323 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | if (current->payload_type == 1) |
| 324 | ✗ | sei_type = SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME; | |
| 325 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
|
24 | else if (current->payload_type == 2) |
| 326 | ✗ | sei_type = SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO; | |
| 327 |
1/2✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
|
24 | else if (current->payload_type == 4) |
| 328 | 24 | sei_type = SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35; | |
| 329 | ✗ | else if (current->payload_type == 5) | |
| 330 | ✗ | sei_type = SEI_TYPE_USER_DATA_UNREGISTERED; | |
| 331 | else { | ||
| 332 | uint8_t *data; | ||
| 333 | |||
| 334 | #ifdef READ | ||
| 335 | ✗ | current->payload_size = payload_size; | |
| 336 | ✗ | allocate(current->payload_ref, current->payload_size); | |
| 337 | ✗ | current->payload = current->payload_ref; | |
| 338 | #else | ||
| 339 | ✗ | allocate(current->payload, current->payload_size); | |
| 340 | #endif | ||
| 341 | ✗ | data = current->payload; | |
| 342 | |||
| 343 | ✗ | for (i = 0; i < current->payload_size; i++) | |
| 344 | ✗ | xu(8, reserved_sei_message_payload_byte[i], data[i], 0, 255, 1, i); | |
| 345 | |||
| 346 | ✗ | return 0; | |
| 347 | } | ||
| 348 | |||
| 349 | 24 | message->payload_type = sei_type; | |
| 350 | 24 | message->payload_size = payload_size; | |
| 351 | |||
| 352 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | CHECK(FUNC_SEI(message)(ctx, rw, message)); |
| 353 | |||
| 354 | 24 | return 0; | |
| 355 | } | ||
| 356 | |||
| 357 | 12 | static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 358 | LCEVCRawVUI *current) | ||
| 359 | { | ||
| 360 | int err; | ||
| 361 | |||
| 362 | 12 | HEADER("VUI Parameters"); | |
| 363 | |||
| 364 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | flag(aspect_ratio_info_present_flag); |
| 365 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
12 | if (current->aspect_ratio_info_present_flag) { |
| 366 | ✗ | ub(8, aspect_ratio_idc); | |
| 367 | |||
| 368 | ✗ | if (current->aspect_ratio_idc == 255) { | |
| 369 | ✗ | ub(16, sar_width); | |
| 370 | ✗ | ub(16, sar_height); | |
| 371 | } | ||
| 372 | } else { | ||
| 373 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
12 | infer(aspect_ratio_idc, 0); |
| 374 | } | ||
| 375 | |||
| 376 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | flag(overscan_info_present_flag); |
| 377 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
12 | if (current->overscan_info_present_flag) |
| 378 | ✗ | flag(overscan_appropriate_flag); | |
| 379 | else | ||
| 380 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
12 | infer(overscan_appropriate_flag, 0); |
| 381 | |||
| 382 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | flag(video_signal_type_present_flag); |
| 383 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
12 | if (current->video_signal_type_present_flag) { |
| 384 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | u(3, video_format, 0, 5); |
| 385 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | flag(video_full_range_flag); |
| 386 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | flag(colour_description_present_flag); |
| 387 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
12 | if (current->colour_description_present_flag) { |
| 388 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | ub(8, colour_primaries); |
| 389 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | ub(8, transfer_characteristics); |
| 390 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | ub(8, matrix_coefficients); |
| 391 | } else { | ||
| 392 | ✗ | infer(colour_primaries, 2); | |
| 393 | ✗ | infer(transfer_characteristics, 2); | |
| 394 | ✗ | infer(matrix_coefficients, 2); | |
| 395 | } | ||
| 396 | } else { | ||
| 397 | ✗ | infer(video_format, 5); | |
| 398 | ✗ | infer(video_full_range_flag, 0); | |
| 399 | ✗ | infer(colour_description_present_flag, 0); | |
| 400 | ✗ | infer(colour_primaries, 2); | |
| 401 | ✗ | infer(transfer_characteristics, 2); | |
| 402 | ✗ | infer(matrix_coefficients, 2); | |
| 403 | } | ||
| 404 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | flag(chroma_loc_info_present_flag); |
| 405 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
12 | if (current->chroma_loc_info_present_flag) { |
| 406 | ✗ | ue(chroma_sample_loc_type_top_field, 0, 5); | |
| 407 | ✗ | ue(chroma_sample_loc_type_bottom_field, 0, 5); | |
| 408 | } else { | ||
| 409 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
12 | infer(chroma_sample_loc_type_top_field, 0); |
| 410 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
12 | infer(chroma_sample_loc_type_bottom_field, 0); |
| 411 | } | ||
| 412 | |||
| 413 | 12 | return 0; | |
| 414 | } | ||
| 415 | |||
| 416 | 96 | LCEVC_BLOCK_FUNC(additional_info, (CodedBitstreamContext *ctx, RWContext *rw, | |
| 417 | LCEVCRawAdditionalInfo *current, | ||
| 418 | LCEVCProcessBlockState *state, | ||
| 419 | int nal_unit_type)) | ||
| 420 | { | ||
| 421 | int i, err; | ||
| 422 | |||
| 423 | 48 | HEADER("Additional Info"); | |
| 424 | |||
| 425 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
|
48 | ub(8, additional_info_type); |
| 426 | |||
| 427 |
2/2✓ Branch 0 taken 12 times.
✓ Branch 1 taken 12 times.
|
48 | if (current->additional_info_type == LCEVC_ADDITIONAL_INFO_TYPE_SEI) { |
| 428 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
|
24 | CHECK(FUNC(sei_payload)(ctx, rw, ¤t->sei, state->payload_size - 2)); |
| 429 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 6 times.
|
24 | } else if (current->additional_info_type == LCEVC_ADDITIONAL_INFO_TYPE_VUI) |
| 430 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | CHECK(FUNC(vui_parameters)(ctx, rw, ¤t->vui)); |
| 431 | else { | ||
| 432 | uint8_t *data; | ||
| 433 | |||
| 434 | #ifdef READ | ||
| 435 | 4 | current->payload_size = state->payload_size - 1; | |
| 436 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
|
4 | allocate(current->payload_ref, current->payload_size); |
| 437 | 4 | current->payload = current->payload_ref; | |
| 438 | #else | ||
| 439 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
8 | allocate(current->payload, current->payload_size); |
| 440 | #endif | ||
| 441 | 12 | data = current->payload; | |
| 442 | |||
| 443 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 6 times.
|
24 | for (i = 0; i < current->payload_size; i++) |
| 444 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | xu(8, additional_info_byte[i], data[i], 0, 255, 1, i); |
| 445 | } | ||
| 446 | |||
| 447 | 48 | return 0; | |
| 448 | } | ||
| 449 | |||
| 450 | ✗ | LCEVC_BLOCK_FUNC(filler, (CodedBitstreamContext *ctx, RWContext *rw, | |
| 451 | LCEVCRawFiller *current, | ||
| 452 | LCEVCProcessBlockState *state, | ||
| 453 | int nal_unit_type)) | ||
| 454 | { | ||
| 455 | int err; | ||
| 456 | |||
| 457 | ✗ | HEADER("Filler"); | |
| 458 | |||
| 459 | |||
| 460 | #ifdef READ | ||
| 461 | ✗ | while (show_bits(rw, 8) == 0xaa) { | |
| 462 | ✗ | fixed(8, filler_byte, 0xaa); | |
| 463 | ✗ | ++current->filler_size; | |
| 464 | } | ||
| 465 | ✗ | if (state->payload_size != current->filler_size) | |
| 466 | ✗ | return AVERROR_INVALIDDATA; | |
| 467 | |||
| 468 | #else | ||
| 469 | ✗ | for (int i = 0; i < current->filler_size; i++) | |
| 470 | ✗ | fixed(8, filler_byte, 0xaa); | |
| 471 | #endif | ||
| 472 | |||
| 473 | ✗ | return 0; | |
| 474 | } | ||
| 475 | |||
| 476 | 468 | static int FUNC(process_block)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 477 | LCEVCRawProcessBlock *current, | ||
| 478 | int nal_unit_type) | ||
| 479 | { | ||
| 480 | const LCEVCProcessBlockTypeDescriptor *desc; | ||
| 481 | int err, i; | ||
| 482 | |||
| 483 | 468 | desc = ff_cbs_lcevc_process_block_find_type(ctx, current->payload_type); | |
| 484 |
1/2✓ Branch 0 taken 234 times.
✗ Branch 1 not taken.
|
468 | if (desc) { |
| 485 | 468 | LCEVCProcessBlockState state = { | |
| 486 | 468 | .payload_type = current->payload_type, | |
| 487 | 468 | .payload_size = current->payload_size, | |
| 488 | 468 | .extension_present = current->extension_bit_length > 0, | |
| 489 | }; | ||
| 490 | int start_position, current_position, bits_written; | ||
| 491 | |||
| 492 | #ifdef READ | ||
| 493 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | CHECK(ff_cbs_lcevc_alloc_process_block_payload(current, desc)); |
| 494 | #endif | ||
| 495 | |||
| 496 | 468 | start_position = bit_position(rw); | |
| 497 | |||
| 498 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 234 times.
|
468 | CHECK(desc->READWRITE(ctx, rw, current->payload, &state, nal_unit_type)); |
| 499 | |||
| 500 | 468 | current_position = bit_position(rw); | |
| 501 | 468 | bits_written = current_position - start_position; | |
| 502 | |||
| 503 |
3/4✓ Branch 1 taken 228 times.
✓ Branch 2 taken 6 times.
✓ Branch 3 taken 228 times.
✗ Branch 4 not taken.
|
468 | if (byte_alignment(rw) || state.extension_present || |
| 504 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 228 times.
|
456 | bits_written < 8 * current->payload_size) { |
| 505 | size_t bits_left; | ||
| 506 | |||
| 507 | #ifdef READ | ||
| 508 | 4 | GetBitContext tmp = *rw; | |
| 509 | int trailing_bits, trailing_zero_bits; | ||
| 510 | |||
| 511 | 4 | bits_left = 8 * current->payload_size - bits_written; | |
| 512 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
4 | if (bits_left > 8) |
| 513 | ✗ | skip_bits_long(&tmp, bits_left - 8); | |
| 514 | 4 | trailing_bits = get_bits(&tmp, FFMIN(bits_left, 8)); | |
| 515 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
4 | if (trailing_bits == 0) { |
| 516 | // The trailing bits must contain a payload_bit_equal_to_one, so | ||
| 517 | // they can't all be zero. | ||
| 518 | // Don't error out as encodings following a faulty specification | ||
| 519 | // syntax trigger this. | ||
| 520 | ✗ | av_log(ctx->log_ctx, AV_LOG_DEBUG, "Missing alignment bits in Process Block\n"); | |
| 521 | ✗ | return 0; | |
| 522 | } | ||
| 523 | 4 | trailing_zero_bits = ff_ctz(trailing_bits); | |
| 524 | 4 | current->extension_bit_length = | |
| 525 | 4 | bits_left - 1 - trailing_zero_bits; | |
| 526 | #endif | ||
| 527 | |||
| 528 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
|
12 | if (current->extension_bit_length > 0) { |
| 529 | ✗ | allocate(current->extension_data, | |
| 530 | (current->extension_bit_length + 7) / 8); | ||
| 531 | |||
| 532 | ✗ | bits_left = current->extension_bit_length; | |
| 533 | ✗ | for (i = 0; bits_left > 0; i++) { | |
| 534 | ✗ | int length = FFMIN(bits_left, 8); | |
| 535 | ✗ | xu(length, reserved_payload_extension_data, | |
| 536 | current->extension_data[i], | ||
| 537 | 0, MAX_UINT_BITS(length), 0); | ||
| 538 | ✗ | bits_left -= length; | |
| 539 | } | ||
| 540 | } | ||
| 541 | |||
| 542 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
|
12 | fixed(1, payload_bit_equal_to_one, 1); |
| 543 |
2/2✓ Branch 1 taken 36 times.
✓ Branch 2 taken 6 times.
|
84 | while (byte_alignment(rw)) |
| 544 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 36 times.
|
72 | fixed(1, payload_bit_equal_to_zero, 0); |
| 545 | } | ||
| 546 | |||
| 547 | #ifdef WRITE | ||
| 548 | 312 | current->payload_size = (put_bits_count(rw) - start_position) / 8; | |
| 549 | #endif | ||
| 550 | } else { | ||
| 551 | uint8_t *data; | ||
| 552 | |||
| 553 | #ifdef READ | ||
| 554 | ✗ | allocate(current->payload_ref, current->payload_size); | |
| 555 | ✗ | current->payload = current->payload_ref; | |
| 556 | #else | ||
| 557 | ✗ | allocate(current->payload, current->payload_size); | |
| 558 | #endif | ||
| 559 | ✗ | data = current->payload; | |
| 560 | |||
| 561 | ✗ | for (i = 0; i < current->payload_size; i++) | |
| 562 | ✗ | xu(8, payload_byte[i], data[i], 0, 255, 1, i); | |
| 563 | } | ||
| 564 | |||
| 565 | 468 | return 0; | |
| 566 | } | ||
| 567 | |||
| 568 | 132 | static int FUNC(process_block_list)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 569 | LCEVCRawProcessBlockList *current, | ||
| 570 | int nal_unit_type) | ||
| 571 | { | ||
| 572 | LCEVCRawProcessBlock *block; | ||
| 573 | int err, k; | ||
| 574 | |||
| 575 | #ifdef READ | ||
| 576 | 156 | for (k = 0;; k++) { | |
| 577 | int payload_size_type; | ||
| 578 | int payload_type; | ||
| 579 | uint32_t payload_size; | ||
| 580 | uint32_t tmp; | ||
| 581 | GetBitContext payload_gbc; | ||
| 582 | |||
| 583 | 156 | HEADER("Process Block"); | |
| 584 | |||
| 585 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | xu(3, payload_size_type, tmp, 0, MAX_UINT_BITS(3), 0); |
| 586 | 156 | payload_size_type = tmp; | |
| 587 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | xu(5, payload_type, tmp, 0, MAX_UINT_BITS(5), 0); |
| 588 | 156 | payload_type = tmp; | |
| 589 | |||
| 590 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 78 times.
|
156 | if (payload_size_type == 6) { |
| 591 | ✗ | av_log(ctx->log_ctx, AV_LOG_ERROR, "payload_size_type == 6\n"); | |
| 592 | ✗ | return AVERROR_INVALIDDATA; | |
| 593 | } | ||
| 594 | |||
| 595 | 156 | payload_size = payload_size_type; | |
| 596 |
2/2✓ Branch 0 taken 39 times.
✓ Branch 1 taken 39 times.
|
156 | if (payload_size_type == 7) |
| 597 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 39 times.
|
78 | xmb(custom_byte_size, payload_size); |
| 598 | |||
| 599 | // There must be space remaining for the payload | ||
| 600 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | if (payload_size > get_bits_left(rw) / 8) { |
| 601 | ✗ | av_log(ctx->log_ctx, AV_LOG_ERROR, | |
| 602 | "Invalid process block: payload_size too large " | ||
| 603 | "(%"PRIu32" bytes).\n", payload_size); | ||
| 604 | ✗ | return AVERROR_INVALIDDATA; | |
| 605 | } | ||
| 606 |
1/2✗ Branch 2 not taken.
✓ Branch 3 taken 78 times.
|
156 | CHECK(init_get_bits(&payload_gbc, rw->buffer, |
| 607 | get_bits_count(rw) + 8 * payload_size)); | ||
| 608 | 156 | skip_bits_long(&payload_gbc, get_bits_count(rw)); | |
| 609 | |||
| 610 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | CHECK(ff_cbs_lcevc_list_add(current, -1)); |
| 611 | 156 | block = ¤t->blocks[k]; | |
| 612 | |||
| 613 | 156 | block->payload_type = payload_type; | |
| 614 | 156 | block->payload_size = payload_size; | |
| 615 | |||
| 616 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | CHECK(FUNC(process_block)(ctx, &payload_gbc, block, nal_unit_type)); |
| 617 | |||
| 618 | 156 | skip_bits_long(rw, 8 * payload_size); | |
| 619 | |||
| 620 |
2/2✓ Branch 1 taken 33 times.
✓ Branch 2 taken 45 times.
|
156 | if (!ff_cbs_h2645_read_more_rbsp_data(rw)) |
| 621 | 66 | break; | |
| 622 | } | ||
| 623 | #else | ||
| 624 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 33 times.
|
222 | for (k = 0; k < current->nb_blocks; k++) { |
| 625 | PutBitContext start_state; | ||
| 626 | uint32_t tmp; | ||
| 627 | int trace, i; | ||
| 628 | |||
| 629 | 156 | block = ¤t->blocks[k]; | |
| 630 | |||
| 631 | // We write the payload twice in order to find the size. Trace | ||
| 632 | // output is switched off for the first write. | ||
| 633 | 156 | trace = ctx->trace_enable; | |
| 634 | 156 | ctx->trace_enable = 0; | |
| 635 | |||
| 636 | 156 | start_state = *rw; | |
| 637 |
2/2✓ Branch 0 taken 156 times.
✓ Branch 1 taken 78 times.
|
468 | for (i = 0; i < 2; i++) { |
| 638 | 312 | *rw = start_state; | |
| 639 | |||
| 640 | 312 | tmp = FFMIN(block->payload_size, 7); | |
| 641 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 152 times.
|
312 | if (tmp == 6) |
| 642 | 8 | tmp = 7; | |
| 643 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 156 times.
|
312 | xu(3, payload_size_type, tmp, 0, 7, 0); |
| 644 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 156 times.
|
312 | xu(5, payload_type, block->payload_type, 0, MAX_UINT_BITS(5), 0); |
| 645 | |||
| 646 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 78 times.
|
312 | if (tmp == 7) |
| 647 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 78 times.
|
156 | xmb(custom_byte_size, block->payload_size); |
| 648 | |||
| 649 | 312 | err = FUNC(process_block)(ctx, rw, block, nal_unit_type); | |
| 650 | 312 | ctx->trace_enable = trace; | |
| 651 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 156 times.
|
312 | if (err < 0) |
| 652 | ✗ | return err; | |
| 653 | } | ||
| 654 | } | ||
| 655 | #endif | ||
| 656 | |||
| 657 | 132 | return 0; | |
| 658 | } | ||
| 659 | |||
| 660 | 66 | static int FUNC(nal)(CodedBitstreamContext *ctx, RWContext *rw, | |
| 661 | LCEVCRawNAL *current, int nal_unit_type) | ||
| 662 | { | ||
| 663 | int err; | ||
| 664 | |||
| 665 | 66 | if (nal_unit_type == LCEVC_NON_IDR_NUT) | |
| 666 | 58 | HEADER("Non IDR"); | |
| 667 | else | ||
| 668 | 8 | HEADER("IDR"); | |
| 669 | |||
| 670 | 66 | CHECK(FUNC(nal_unit_header)(ctx, rw, ¤t->nal_unit_header, | |
| 671 | (1 << LCEVC_IDR_NUT) | (1 << LCEVC_NON_IDR_NUT))); | ||
| 672 | |||
| 673 | 66 | CHECK(FUNC(process_block_list) (ctx, rw, ¤t->process_block_list, | |
| 674 | current->nal_unit_header.nal_unit_type)); | ||
| 675 | |||
| 676 | 66 | CHECK(FUNC(rbsp_trailing_bits)(ctx, rw)); | |
| 677 | |||
| 678 | 66 | return 0; | |
| 679 | } | ||
| 680 |