static int map_avcodec_id(enum AVCodecID id)
{
switch (id) {
+#if CONFIG_AV1_NVDEC_HWACCEL
+ case AV_CODEC_ID_AV1: return cudaVideoCodec_AV1;
+#endif
case AV_CODEC_ID_H264: return cudaVideoCodec_H264;
case AV_CODEC_ID_HEVC: return cudaVideoCodec_HEVC;
case AV_CODEC_ID_MJPEG: return cudaVideoCodec_JPEG;
{
int shift_h = 0, shift_v = 0;
+ if (av_pix_fmt_count_planes(pix_fmt) == 1)
+ return cudaVideoChromaFormat_Monochrome;
+
av_pix_fmt_get_chroma_sub_sample(pix_fmt, &shift_h, &shift_v);
if (shift_h == 1 && shift_v == 1)
return ret;
}
-static AVBufferRef *nvdec_decoder_frame_alloc(void *opaque, int size)
+static AVBufferRef *nvdec_decoder_frame_alloc(void *opaque, size_t size)
{
NVDECFramePool *pool = opaque;
AVBufferRef *ret;
NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
av_freep(&ctx->bitstream);
+ av_freep(&ctx->bitstream_internal);
ctx->bitstream_len = 0;
ctx->bitstream_allocated = 0;
av_buffer_pool_uninit(&ctx->pool);
}
-static AVBufferRef *nvdec_alloc_dummy(int size)
+static AVBufferRef *nvdec_alloc_dummy(size_t size)
{
return av_buffer_create(NULL, 0, NULL, NULL, 0);
}