for (i = 0; i < (size * size); i++) {
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
}
- s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride);
+ s->hevcdsp.add_residual[log2_trafo_size_c-2](dst, coeffs, stride);
}
}
for (i = 0; i < (size * size); i++) {
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
}
- s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride);
+ s->hevcdsp.add_residual[log2_trafo_size_c-2](dst, coeffs, stride);
}
}
} else if (s->ps.sps->chroma_format_idc && blk_idx == 3) {
return 0;
}
-static int hevc_decode_extradata(HEVCContext *s)
+static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length)
{
AVCodecContext *avctx = s->avctx;
GetByteContext gb;
int ret, i;
- bytestream2_init(&gb, avctx->extradata, avctx->extradata_size);
+ bytestream2_init(&gb, buf, length);
- if (avctx->extradata_size > 3 &&
- (avctx->extradata[0] || avctx->extradata[1] ||
- avctx->extradata[2] > 1)) {
+ if (length > 3 && (buf[0] || buf[1] || buf[2] > 1)) {
/* It seems the extradata is encoded as hvcC format.
* Temporarily, we support configurationVersion==0 until 14496-15 3rd
* is finalized. When finalized, configurationVersion will be 1 and we
s->nal_length_size = nal_len_size;
} else {
s->is_nalff = 0;
- ret = decode_nal_units(s, avctx->extradata, avctx->extradata_size);
+ ret = decode_nal_units(s, buf, length);
if (ret < 0)
return ret;
}
AVPacket *avpkt)
{
int ret;
+ int new_extradata_size;
+ uint8_t *new_extradata;
HEVCContext *s = avctx->priv_data;
if (!avpkt->size) {
return 0;
}
+ new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
+ &new_extradata_size);
+ if (new_extradata && new_extradata_size > 0) {
+ ret = hevc_decode_extradata(s, new_extradata, new_extradata_size);
+ if (ret < 0)
+ return ret;
+ }
+
s->ref = NULL;
ret = decode_nal_units(s, avpkt->data, avpkt->size);
if (ret < 0)
s->threads_number = 1;
if (avctx->extradata_size > 0 && avctx->extradata) {
- ret = hevc_decode_extradata(s);
+ ret = hevc_decode_extradata(s, avctx->extradata, avctx->extradata_size);
if (ret < 0) {
hevc_decode_free(avctx);
return ret;
.init_thread_copy = hevc_init_thread_copy,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
};