From e0bbaceec060ffddc0df8a72793895d4aecdd866 Mon Sep 17 00:00:00 2001 From: jojo61 Date: Wed, 20 Sep 2023 12:43:52 +0200 Subject: [PATCH] Enable Yadif in Makefile Reverse Bob for mpeg2 --- Makefile | 2 +- codec.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f5d2491..949933d 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ LIBPLACEBO ?= 1 LIBPLACEBO_GL ?= 0 # use YADIF deint - only available with cuvid -#YADIF = 1 +YADIF = 1 # use gamma correction #GAMMA ?= 0 diff --git a/codec.c b/codec.c index ae124c8..3cc684e 100644 --- a/codec.c +++ b/codec.c @@ -307,16 +307,16 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) { #ifdef CUVID if (strcmp(decoder->VideoCodec->long_name, "Nvidia CUVID MPEG2VIDEO decoder") == 0) { // deinterlace for mpeg2 is somehow broken - if (av_opt_set_int(decoder->VideoCtx->priv_data, "deint", 1, 0) < 0) { // adaptive + if (av_opt_set_int(decoder->VideoCtx->priv_data, "deint", deint, 0) < 0) { // adaptive pthread_mutex_unlock(&CodecLockMutex); Fatal(_("codec: can't set option deint to video codec!\n")); } -#if 0 - if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 13, 0) < 0) { + + if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 9, 0) < 0) { pthread_mutex_unlock(&CodecLockMutex); Fatal(_("codec: can't set option surfces to video codec!\n")); } -#endif + if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false", 0) < 0) { pthread_mutex_unlock(&CodecLockMutex); Fatal(_("codec: can't set option drop 2.field to video codec!\n")); @@ -326,12 +326,10 @@ void CodecVideoOpen(VideoDecoder *decoder, int codec_id) { pthread_mutex_unlock(&CodecLockMutex); Fatal(_("codec: can't set option deint to video codec!\n")); } -#if 1 if (av_opt_set_int(decoder->VideoCtx->priv_data, "surfaces", 13, 0) < 0) { pthread_mutex_unlock(&CodecLockMutex); Fatal(_("codec: can't set option surfces to video codec!\n")); } -#endif if (av_opt_set(decoder->VideoCtx->priv_data, "drop_second_field", "false", 0) < 0) { pthread_mutex_unlock(&CodecLockMutex); Fatal(_("codec: can't set option drop 2.field to video codec!\n"));