s->avctx->sample_aspect_ratio = sps->vui.sar;
s->avctx->has_b_frames = sps->temporal_layer[sps->max_sub_layers - 1].num_reorder_pics;
+ if (sps->vui.video_signal_type_present_flag)
+ s->avctx->color_range = sps->vui.video_full_range_flag ? AVCOL_RANGE_JPEG
+ : AVCOL_RANGE_MPEG;
+ else
+ s->avctx->color_range = AVCOL_RANGE_MPEG;
+
+ if (sps->vui.colour_description_present_flag) {
+ s->avctx->color_primaries = sps->vui.colour_primaries;
+ s->avctx->color_trc = sps->vui.transfer_characteristic;
+ s->avctx->colorspace = sps->vui.matrix_coeffs;
+ } else {
+ s->avctx->color_primaries = AVCOL_PRI_UNSPECIFIED;
+ s->avctx->color_trc = AVCOL_TRC_UNSPECIFIED;
+ s->avctx->colorspace = AVCOL_SPC_UNSPECIFIED;
+ }
+
ff_hevc_pred_init(&s->hpc, sps->bit_depth);
ff_hevc_dsp_init (&s->hevcdsp, sps->bit_depth);
ff_videodsp_init (&s->vdsp, sps->bit_depth);
sh->colour_plane_id = get_bits(gb, 2);
if (!IS_IDR(s)) {
- int short_term_ref_pic_set_sps_flag;
- int poc;
+ int short_term_ref_pic_set_sps_flag, poc;
sh->pic_order_cnt_lsb = get_bits(gb, s->sps->log2_max_poc_lsb);
poc = ff_hevc_compute_poc(s, sh->pic_order_cnt_lsb);
y_off >= pic_height - block_h - ff_hevc_qpel_extra_after[my]) {
int offset = extra_top * srcstride + (extra_left << s->sps->pixel_shift);
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, srcstride, src - offset, srcstride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src - offset,
+ srcstride, srcstride,
block_w + ff_hevc_qpel_extra[mx],
block_h + ff_hevc_qpel_extra[my],
x_off - extra_left, y_off - extra_top,
int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << s->sps->pixel_shift));
int offset2 = EPEL_EXTRA_BEFORE * (src2stride + (1 << s->sps->pixel_shift));
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1stride, src1 - offset1, src1stride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src1 - offset1,
+ src1stride, src1stride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
x_off - EPEL_EXTRA_BEFORE,
y_off - EPEL_EXTRA_BEFORE,
s->hevcdsp.put_hevc_epel[!!my][!!mx](dst1, dststride, src1, src1stride,
block_w, block_h, mx, my, lc->mc_buffer);
- s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src2stride, src2 - offset2, src2stride,
+ s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, src2 - offset2,
+ src2stride, src2stride,
block_w + EPEL_EXTRA, block_h + EPEL_EXTRA,
x_off - EPEL_EXTRA_BEFORE,
y_off - EPEL_EXTRA_BEFORE,
int ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
int ctb_addr_in_slice = ctb_addr_rs - s->sh.slice_addr;
- int tile_left_boundary;
- int tile_up_boundary;
- int slice_left_boundary;
- int slice_up_boundary;
+ int tile_left_boundary, tile_up_boundary;
+ int slice_left_boundary, slice_up_boundary;
s->tab_slice_address[ctb_addr_rs] = s->sh.slice_addr;
{
HEVCLocalContext *lc = s->HEVClc;
GetBitContext *gb = &lc->gb;
- int ctb_addr_ts;
- int ret;
+ int ctb_addr_ts, ret;
ret = init_get_bits8(gb, nal, length);
if (ret < 0)
STARTCODE_TEST;
i -= 3;
}
-#endif
+#endif /* HAVE_FAST_64BIT */
#else
for (i = 0; i + 1 < length; i += 2) {
if (src[i])
i--;
STARTCODE_TEST;
}
-#endif
+#endif /* HAVE_FAST_UNALIGNED */
if (i >= length - 1) { // no escaped 0
nal->data = src;
goto fail;
hls_nal_unit(s);
- if (s->nal_unit_type == NAL_EOS_NUT ||
- s->nal_unit_type == NAL_EOB_NUT)
+ if (s->nal_unit_type == NAL_EOB_NUT ||
+ s->nal_unit_type == NAL_EOS_NUT)
s->eos = 1;
buf += consumed;
(avctx->extradata[0] || avctx->extradata[1] ||
avctx->extradata[2] > 1)) {
/* It seems the extradata is encoded as hvcC format.
- * Temporarily, we support configurationVersion==0 until 14496-15 3rd finalized.
- * When finalized, configurationVersion will be 1 and we can recognize hvcC by
- * checking if avctx->extradata[0]==1 or not. */
- int i, j, num_arrays;
- int nal_len_size;
+ * Temporarily, we support configurationVersion==0 until 14496-15 3rd
+ * finalized. When finalized, configurationVersion will be 1 and we
+ * can recognize hvcC by checking if avctx->extradata[0]==1 or not. */
+ int i, j, num_arrays, nal_len_size;
s->is_nalff = 1;
}
}
- /* Now store right nal length size, that will be used to parse all other nals */
+ /* Now store right nal length size, that will be used to parse
+ * all other nals */
s->nal_length_size = nal_len_size;
} else {
s->is_nalff = 0;
#define OFFSET(x) offsetof(HEVCContext, x)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
static const AVOption options[] = {
+ { "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin),
+ AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, PAR },
{ "strict-displaywin", "stricly apply default display window size", OFFSET(apply_defdispwin),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, PAR },
{ NULL },