goto fail;
s->filter_slice_edges = av_malloc(ctb_count);
- s->tab_slice_address = av_malloc(pic_size_in_ctb * sizeof(*s->tab_slice_address));
- s->qp_y_tab = av_malloc(pic_size_in_ctb * sizeof(*s->qp_y_tab));
+ s->tab_slice_address = av_malloc(pic_size_in_ctb *
+ sizeof(*s->tab_slice_address));
+ s->qp_y_tab = av_malloc(pic_size_in_ctb *
+ sizeof(*s->qp_y_tab));
if (!s->qp_y_tab || !s->filter_slice_edges || !s->tab_slice_address)
goto fail;
goto fail;
return 0;
+
fail:
pic_arrays_free(s);
return AVERROR(ENOMEM);
s->sps = sps;
s->vps = s->vps_list[s->sps->vps_id];
return 0;
+
fail:
pic_arrays_free(s);
s->sps = NULL;
s->sps->ctb_height);
sh->slice_segment_addr = get_bits(gb, slice_address_length);
if (sh->slice_segment_addr >= s->sps->ctb_width * s->sps->ctb_height) {
- av_log(s->avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n",
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Invalid slice segment address: %u.\n",
sh->slice_segment_addr);
return AVERROR_INVALIDDATA;
}
skip_bits(gb, 1); // slice_reserved_undetermined_flag[]
sh->slice_type = get_ue_golomb_long(gb);
- if (!(sh->slice_type == I_SLICE || sh->slice_type == P_SLICE ||
+ if (!(sh->slice_type == I_SLICE ||
+ sh->slice_type == P_SLICE ||
sh->slice_type == B_SLICE)) {
av_log(s->avctx, AV_LOG_ERROR, "Unknown slice type: %d.\n",
sh->slice_type);
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);
}
numbits = av_ceil_log2(s->sps->nb_st_rps);
- rps_idx = (numbits > 0) ? get_bits(gb, numbits) : 0;
+ rps_idx = numbits > 0 ? get_bits(gb, numbits) : 0;
sh->short_term_rps = &s->sps->st_rps[rps_idx];
}
sh->slice_temporal_mvp_enabled_flag = 0;
} else {
s->sh.short_term_rps = NULL;
- s->poc = 0;
+ s->poc = 0;
}
/* 8.3.1 */
if (s->temporal_id == 0 &&
s->nal_unit_type != NAL_TRAIL_N &&
- s->nal_unit_type != NAL_TSA_N &&
- s->nal_unit_type != NAL_STSA_N &&
- s->nal_unit_type != NAL_TRAIL_N &&
- s->nal_unit_type != NAL_RADL_N &&
- s->nal_unit_type != NAL_RADL_R &&
+ s->nal_unit_type != NAL_TSA_N &&
+ s->nal_unit_type != NAL_STSA_N &&
+ s->nal_unit_type != NAL_RADL_N &&
+ s->nal_unit_type != NAL_RADL_R &&
+ s->nal_unit_type != NAL_RASL_N &&
s->nal_unit_type != NAL_RASL_R)
s->pocTid0 = s->poc;
sh->collocated_ref_idx = get_ue_golomb_long(gb);
if (sh->collocated_ref_idx >= sh->nb_refs[sh->collocated_list]) {
av_log(s->avctx, AV_LOG_ERROR,
- "Invalid collocated_ref_idx: %d.\n", sh->collocated_ref_idx);
+ "Invalid collocated_ref_idx: %d.\n",
+ sh->collocated_ref_idx);
return AVERROR_INVALIDDATA;
}
}
}
} else {
sh->disable_deblocking_filter_flag = s->pps->disable_dbf;
- sh->beta_offset = s->pps->beta_offset;
- sh->tc_offset = s->pps->tc_offset;
+ sh->beta_offset = s->pps->beta_offset;
+ sh->tc_offset = s->pps->tc_offset;
}
} else {
sh->disable_deblocking_filter_flag = 0;
- sh->beta_offset = 0;
- sh->tc_offset = 0;
+ sh->beta_offset = 0;
+ sh->tc_offset = 0;
}
if (s->pps->seq_loop_filter_across_slices_enabled_flag &&
if (sao->type_idx[c_idx] == SAO_BAND) {
for (i = 0; i < 4; i++) {
if (sao->offset_abs[c_idx][i]) {
- SET_SAO(offset_sign[c_idx][i], ff_hevc_sao_offset_sign_decode(s));
+ SET_SAO(offset_sign[c_idx][i],
+ ff_hevc_sao_offset_sign_decode(s));
} else {
sao->offset_sign[c_idx][i] = 0;
}
#undef SET_SAO
#undef CTB
-
static void hls_transform_unit(HEVCContext *s, int x0, int y0,
int xBase, int yBase, int cb_xBase, int cb_yBase,
int log2_cb_size, int log2_trafo_size,
s->hpc.intra_pred(s, x0, y0, log2_trafo_size - 1, 1);
s->hpc.intra_pred(s, x0, y0, log2_trafo_size - 1, 2);
} else if (blk_idx == 3) {
- trafo_size = trafo_size << (s->sps->hshift[1]);
- ff_hevc_set_neighbour_available(s, xBase, yBase, trafo_size, trafo_size);
+ trafo_size = trafo_size << s->sps->hshift[1];
+ ff_hevc_set_neighbour_available(s, xBase, yBase,
+ trafo_size, trafo_size);
s->hpc.intra_pred(s, xBase, yBase, log2_trafo_size, 1);
s->hpc.intra_pred(s, xBase, yBase, log2_trafo_size, 2);
}
scan_idx = SCAN_HORIZ;
}
- if (lc->pu.intra_pred_mode_c >= 6 &&
+ if (lc->pu.intra_pred_mode_c >= 6 &&
lc->pu.intra_pred_mode_c <= 14) {
scan_idx_c = SCAN_VERT;
} else if (lc->pu.intra_pred_mode_c >= 22 &&
int cb_size = 1 << log2_cb_size;
int log2_min_pu_size = s->sps->log2_min_pu_size;
- int min_pu_width = s->sps->min_pu_width;
+ int min_pu_width = s->sps->min_pu_width;
int x_end = FFMIN(x0 + cb_size, s->sps->width);
int y_end = FFMIN(y0 + cb_size, s->sps->height);
int i, j;
lc->tt.cbf_luma = 1;
- lc->tt.inter_split_flag = (s->sps->max_transform_hierarchy_depth_inter == 0 &&
- lc->cu.pred_mode == MODE_INTER &&
- lc->cu.part_mode != PART_2Nx2N && trafo_depth == 0);
+ lc->tt.inter_split_flag = s->sps->max_transform_hierarchy_depth_inter == 0 &&
+ lc->cu.pred_mode == MODE_INTER &&
+ lc->cu.part_mode != PART_2Nx2N &&
+ trafo_depth == 0;
if (log2_trafo_size <= s->sps->log2_max_trafo_size &&
- log2_trafo_size > s->sps->log2_min_tb_size &&
- trafo_depth < lc->cu.max_trafo_depth &&
+ log2_trafo_size > s->sps->log2_min_tb_size &&
+ trafo_depth < lc->cu.max_trafo_depth &&
!(lc->cu.intra_split_flag && trafo_depth == 0)) {
split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size);
} else {
- split_transform_flag = (log2_trafo_size > s->sps->log2_max_trafo_size ||
- (lc->cu.intra_split_flag && (trafo_depth == 0)) ||
- lc->tt.inter_split_flag);
+ split_transform_flag = log2_trafo_size > s->sps->log2_max_trafo_size ||
+ (lc->cu.intra_split_flag && trafo_depth == 0) ||
+ lc->tt.inter_split_flag;
}
if (log2_trafo_size > 2) {
ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
- if (trafo_depth == 0 || SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase)) {
+ if (trafo_depth == 0 ||
+ SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase)) {
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) =
ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size,
lc->slice_or_tiles_up_boundary,
lc->slice_or_tiles_left_boundary);
- if (s->pps->transquant_bypass_enable_flag && lc->cu.cu_transquant_bypass_flag)
+ if (s->pps->transquant_bypass_enable_flag &&
+ lc->cu.cu_transquant_bypass_flag)
set_deblocking_bypass(s, x0, y0, log2_trafo_size);
}
}
if (ret < 0)
return ret;
- s->hevcdsp.put_pcm(dst0, stride0, cb_size, &gb, s->sps->pcm.bit_depth);
+ s->hevcdsp.put_pcm(dst0, stride0, cb_size, &gb, s->sps->pcm.bit_depth);
s->hevcdsp.put_pcm(dst1, stride1, cb_size / 2, &gb, s->sps->pcm.bit_depth_chroma);
s->hevcdsp.put_pcm(dst2, stride2, cb_size / 2, &gb, s->sps->pcm.bit_depth_chroma);
return 0;
int offset = extra_top * srcstride + (extra_left << s->sps->pixel_shift);
s->vdsp.emulated_edge_mc(lc->edge_emu_buffer, srcstride, src - offset, srcstride,
- block_w + ff_hevc_qpel_extra[mx], block_h + ff_hevc_qpel_extra[my],
+ block_w + ff_hevc_qpel_extra[mx],
+ block_h + ff_hevc_qpel_extra[my],
x_off - extra_left, y_off - extra_top,
pic_width, pic_height);
src = lc->edge_emu_buffer + offset;
* @param block_w width of block
* @param block_h height of block
*/
-static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2, ptrdiff_t dststride, AVFrame *ref,
- const Mv *mv, int x_off, int y_off, int block_w, int block_h)
+static void chroma_mc(HEVCContext *s, int16_t *dst1, int16_t *dst2,
+ ptrdiff_t dststride, AVFrame *ref, const Mv *mv,
+ int x_off, int y_off, int block_w, int block_h)
{
HEVCLocalContext *lc = s->HEVClc;
uint8_t *src1 = ref->data[1];
else
merge_idx = 0;
- ff_hevc_luma_mv_merge_mode(s, x0, y0, 1 << log2_cb_size, 1 << log2_cb_size,
- log2_cb_size, partIdx, merge_idx, ¤t_mv);
+ ff_hevc_luma_mv_merge_mode(s, x0, y0,
+ 1 << log2_cb_size,
+ 1 << log2_cb_size,
+ log2_cb_size, partIdx,
+ merge_idx, ¤t_mv);
x_pu = x0 >> s->sps->log2_min_pu_size;
y_pu = y0 >> s->sps->log2_min_pu_size;
ff_hevc_hls_mvd_coding(s, x0, y0, 0);
mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
- partIdx, merge_idx, ¤t_mv, mvp_flag[0], 0);
+ partIdx, merge_idx, ¤t_mv,
+ mvp_flag[0], 0);
current_mv.mv[0].x += lc->pu.mvd.x;
current_mv.mv[0].y += lc->pu.mvd.y;
}
current_mv.pred_flag[1] = 1;
mvp_flag[1] = ff_hevc_mvp_lx_flag_decode(s);
ff_hevc_luma_mv_mvp_mode(s, x0, y0, nPbW, nPbH, log2_cb_size,
- partIdx, merge_idx, ¤t_mv, mvp_flag[1], 1);
+ partIdx, merge_idx, ¤t_mv,
+ mvp_flag[1], 1);
current_mv.mv[1].x += lc->pu.mvd.x;
current_mv.mv[1].y += lc->pu.mvd.y;
}
}
if (current_mv.pred_flag[0] && !current_mv.pred_flag[1]) {
- DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
+ DECLARE_ALIGNED(16, int16_t, tmp[MAX_PB_SIZE * MAX_PB_SIZE]);
DECLARE_ALIGNED(16, int16_t, tmp2[MAX_PB_SIZE * MAX_PB_SIZE]);
luma_mc(s, tmp, tmpstride, ref0->frame,
int y_cb = y0 >> log2_min_cb_size;
int x, y;
- lc->cu.x = x0;
- lc->cu.y = y0;
- lc->cu.rqt_root_cbf = 1;
+ lc->cu.x = x0;
+ lc->cu.y = y0;
+ lc->cu.rqt_root_cbf = 1;
+ lc->cu.pred_mode = MODE_INTRA;
+ lc->cu.part_mode = PART_2Nx2N;
+ lc->cu.intra_split_flag = 0;
+ lc->cu.pcm_flag = 0;
- lc->cu.pred_mode = MODE_INTRA;
- lc->cu.part_mode = PART_2Nx2N;
- lc->cu.intra_split_flag = 0;
- lc->cu.pcm_flag = 0;
SAMPLE_CTB(s->skip_flag, x_cb, y_cb) = 0;
for (x = 0; x < 4; x++)
lc->pu.intra_pred_mode[x] = 1;
hls_prediction_unit(s, x0, y0, cb_size, cb_size, log2_cb_size, 0);
break;
case PART_2NxN:
- hls_prediction_unit(s, x0, y0, cb_size, cb_size / 2, log2_cb_size, 0);
- hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size, cb_size/2, log2_cb_size, 1);
+ hls_prediction_unit(s, x0, y0, cb_size, cb_size / 2, log2_cb_size, 0);
+ hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size, cb_size / 2, log2_cb_size, 1);
break;
case PART_Nx2N:
- hls_prediction_unit(s, x0, y0, cb_size / 2, cb_size, log2_cb_size, 0);
+ hls_prediction_unit(s, x0, y0, cb_size / 2, cb_size, log2_cb_size, 0);
hls_prediction_unit(s, x0 + cb_size / 2, y0, cb_size / 2, cb_size, log2_cb_size, 1);
break;
case PART_2NxnU:
- hls_prediction_unit(s, x0, y0, cb_size, cb_size / 4, log2_cb_size, 0);
+ hls_prediction_unit(s, x0, y0, cb_size, cb_size / 4, log2_cb_size, 0);
hls_prediction_unit(s, x0, y0 + cb_size / 4, cb_size, cb_size * 3 / 4, log2_cb_size, 1);
break;
case PART_2NxnD:
- hls_prediction_unit(s, x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0);
- hls_prediction_unit(s, x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1);
+ hls_prediction_unit(s, x0, y0, cb_size, cb_size * 3 / 4, log2_cb_size, 0);
+ hls_prediction_unit(s, x0, y0 + cb_size * 3 / 4, cb_size, cb_size / 4, log2_cb_size, 1);
break;
case PART_nLx2N:
- hls_prediction_unit(s, x0, y0, cb_size / 4, cb_size, log2_cb_size,0);
+ hls_prediction_unit(s, x0, y0, cb_size / 4, cb_size, log2_cb_size, 0);
hls_prediction_unit(s, x0 + cb_size / 4, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 1);
break;
case PART_nRx2N:
- hls_prediction_unit(s, x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size,0);
- hls_prediction_unit(s, x0 + cb_size * 3 / 4, y0, cb_size/4, cb_size, log2_cb_size, 1);
+ hls_prediction_unit(s, x0, y0, cb_size * 3 / 4, cb_size, log2_cb_size, 0);
+ hls_prediction_unit(s, x0 + cb_size * 3 / 4, y0, cb_size / 4, cb_size, log2_cb_size, 1);
break;
case PART_NxN:
- hls_prediction_unit(s, x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0);
- hls_prediction_unit(s, x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1);
- hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2);
+ hls_prediction_unit(s, x0, y0, cb_size / 2, cb_size / 2, log2_cb_size, 0);
+ hls_prediction_unit(s, x0 + cb_size / 2, y0, cb_size / 2, cb_size / 2, log2_cb_size, 1);
+ hls_prediction_unit(s, x0, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 2);
hls_prediction_unit(s, x0 + cb_size / 2, y0 + cb_size / 2, cb_size / 2, cb_size / 2, log2_cb_size, 3);
break;
}
int ret;
lc->ct.depth = cb_depth;
- if ((x0 + cb_size <= s->sps->width) &&
- (y0 + cb_size <= s->sps->height) &&
+ if (x0 + cb_size <= s->sps->width &&
+ y0 + cb_size <= s->sps->height &&
log2_cb_size > s->sps->log2_min_cb_size) {
SAMPLE(s->split_cu_flag, x0, y0) =
ff_hevc_split_coding_unit_flag_decode(s, cb_depth, x0, y0);
const int cb_size_split = cb_size >> 1;
const int x1 = x0 + cb_size_split;
const int y1 = y0 + cb_size_split;
+
int more_data = 0;
more_data = hls_coding_quadtree(s, x0, y0, log2_cb_size - 1, cb_depth + 1);
return 0;
}
-static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, int ctb_addr_ts)
+static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb,
+ int ctb_addr_ts)
{
HEVCLocalContext *lc = s->HEVClc;
int ctb_size = 1 << s->sps->log2_ctb_size;
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;
lc->end_of_tiles_y = FFMIN(y_ctb + ctb_size, s->sps->height);
if (s->pps->tiles_enabled_flag) {
- tile_left_boundary = ((x_ctb > 0) &&
- (s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]]));
- slice_left_boundary = ((x_ctb > 0) &&
- (s->tab_slice_address[ctb_addr_rs] == s->tab_slice_address[ctb_addr_rs - 1]));
- tile_up_boundary = ((y_ctb > 0) &&
- (s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]]));
- slice_up_boundary = ((y_ctb > 0) &&
- (s->tab_slice_address[ctb_addr_rs] == s->tab_slice_address[ctb_addr_rs - s->sps->ctb_width]));
+ tile_left_boundary = x_ctb > 0 &&
+ s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - 1]];
+ slice_left_boundary = x_ctb > 0 &&
+ s->tab_slice_address[ctb_addr_rs] == s->tab_slice_address[ctb_addr_rs - 1];
+ tile_up_boundary = y_ctb > 0 &&
+ s->pps->tile_id[ctb_addr_ts] == s->pps->tile_id[s->pps->ctb_addr_rs_to_ts[ctb_addr_rs - s->sps->ctb_width]];
+ slice_up_boundary = y_ctb > 0 &&
+ s->tab_slice_address[ctb_addr_rs] == s->tab_slice_address[ctb_addr_rs - s->sps->ctb_width];
} else {
tile_left_boundary =
tile_up_boundary = 1;
while (more_data && ctb_addr_ts < s->sps->ctb_size) {
int ctb_addr_rs = s->pps->ctb_addr_ts_to_rs[ctb_addr_ts];
- x_ctb = (ctb_addr_rs % ((s->sps->width + (ctb_size - 1)) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
- y_ctb = (ctb_addr_rs / ((s->sps->width + (ctb_size - 1)) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
+ x_ctb = (ctb_addr_rs % ((s->sps->width + ctb_size - 1) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
+ y_ctb = (ctb_addr_rs / ((s->sps->width + ctb_size - 1) >> s->sps->log2_ctb_size)) << s->sps->log2_ctb_size;
hls_decode_neighbour(s, x_ctb, y_ctb, ctb_addr_ts);
ff_hevc_cabac_init(s, ctb_addr_ts);
static void restore_tqb_pixels(HEVCContext *s)
{
- int min_pu_size = 1 << s->sps->log2_min_pu_size;
+ int min_pu_size = 1 << s->sps->log2_min_pu_size;
int x, y, c_idx;
for (c_idx = 0; c_idx < 3; c_idx++) {
static int hevc_frame_start(HEVCContext *s)
{
- HEVCLocalContext *lc = s->HEVClc;
+ HEVCLocalContext *lc = s->HEVClc;
int ret;
memset(s->horizontal_bs, 0, 2 * s->bs_width * (s->bs_height + 1));
ff_thread_finish_setup(s->avctx);
return 0;
+
fail:
if (s->ref && s->threads_type == FF_THREAD_FRAME)
ff_thread_report_progress(&s->ref->tf, INT_MAX, 0);
{
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)
ctb_addr_ts = hls_slice_data_wpp(s, nal, length);
else
ctb_addr_ts = hls_slice_data(s);
-
if (ctb_addr_ts >= (s->sps->ctb_width * s->sps->ctb_height)) {
s->is_decoded = 1;
if ((s->pps->transquant_bypass_enable_flag ||
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;
}
while (si < length)
dst[di++] = src[si++];
-nsc:
+nsc:
memset(dst + di, 0, FF_INPUT_BUFFER_PADDING_SIZE);
nal->data = dst;
}
}
- buf += 3;
- length -= 3;
+ buf += 3;
+ length -= 3;
}
if (!s->is_nalff)
goto fail;
}
s->nals = tmp;
- memset(s->nals + s->nals_allocated, 0, (new_size - s->nals_allocated) * sizeof(*tmp));
+ memset(s->nals + s->nals_allocated, 0,
+ (new_size - s->nals_allocated) * sizeof(*tmp));
av_reallocp_array(&s->skipped_bytes_nal, new_size, sizeof(*s->skipped_bytes_nal));
av_reallocp_array(&s->skipped_bytes_pos_size_nal, new_size, sizeof(*s->skipped_bytes_pos_size_nal));
av_reallocp_array(&s->skipped_bytes_pos_nal, new_size, sizeof(*s->skipped_bytes_pos_nal));
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;
return ret;
}
-static void print_md5(void *log_ctx, int level, uint8_t md5[16])
+static void print_md5(void *log_ctx, int level, uint8_t md5[16])
{
int i;
for (i = 0; i < 16; i++)
}
s->ref = NULL;
- ret = decode_nal_units(s, avpkt->data, avpkt->size);
+ ret = decode_nal_units(s, avpkt->data, avpkt->size);
if (ret < 0)
return ret;
pic_arrays_free(s);
- av_freep(&lc->edge_emu_buffer);
+ if (lc)
+ av_freep(&lc->edge_emu_buffer);
av_freep(&s->md5_ctx);
for(i=0; i < s->nals_allocated; i++) {
s->context_initialized = 1;
return 0;
+
fail:
hevc_decode_free(avctx);
return AVERROR(ENOMEM);
(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;
ret = decode_nal_units(s, gb.buffer, nalsize);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR,
- "Decoding nal unit %d %d from hvcC failed\n", type, i);
+ "Decoding nal unit %d %d from hvcC failed\n",
+ type, i);
return ret;
}
bytestream2_skip(&gb, nalsize);
}
}
- /* 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;
return ret;
s->enable_parallel_tiles = 0;
+ s->picture_struct = 0;
if(avctx->active_thread_type & FF_THREAD_SLICE)
s->threads_number = avctx->thread_count;
#define OFFSET(x) offsetof(HEVCContext, x)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
static const AVOption options[] = {
- { "strict-displaywin", "stricly apply default display window size", OFFSET(strict_def_disp_win),
+ { "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 },
};
.flush = hevc_decode_flush,
.update_thread_context = hevc_update_thread_context,
.init_thread_copy = hevc_init_thread_copy,
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
+ CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
};