mirror of https://git.ffmpeg.org/ffmpeg.git
Compare commits
5 Commits
1a8d50e379
...
cae0f2bc55
Author | SHA1 | Date |
---|---|---|
Michael Niedermayer | cae0f2bc55 | |
Michael Niedermayer | 191950d1bf | |
Michael Niedermayer | c9c11a0866 | |
Michael Niedermayer | 82cce20934 | |
Diego Felix de Souza | 9d675bb60d |
|
@ -76,8 +76,7 @@ static int str_to_dict(char* optstr, AVDictionary **opt)
|
|||
if (value == NULL)
|
||||
return AVERROR(EINVAL);
|
||||
av_dict_set(opt, key, value, 0);
|
||||
} while(key != NULL);
|
||||
return 0;
|
||||
} while(1);
|
||||
}
|
||||
|
||||
static int dynamic_set_parameter(AVCodecContext *avctx)
|
||||
|
@ -335,17 +334,15 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec, char *optstr)
|
|||
|
||||
fail:
|
||||
av_frame_free(&frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const AVCodec *enc_codec;
|
||||
int ret = 0;
|
||||
AVPacket *dec_pkt;
|
||||
AVPacket *dec_pkt = NULL;
|
||||
|
||||
if (argc < 5 || (argc - 5) % 2) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Usage: %s <input file> <encoder> <output file>"
|
||||
|
|
|
@ -215,10 +215,8 @@ static int dec_enc(AVPacket *pkt, const AVCodec *enc_codec)
|
|||
|
||||
fail:
|
||||
av_frame_free(&frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
|
|
@ -514,7 +514,7 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
|
|||
}
|
||||
|
||||
ret = nvenc_check_cap(avctx, NV_ENC_CAPS_SUPPORT_10BIT_ENCODE);
|
||||
if (IS_10BIT(ctx->data_pix_fmt) && ret <= 0) {
|
||||
if ((IS_10BIT(ctx->data_pix_fmt) || ctx->highbitdepth) && ret <= 0) {
|
||||
av_log(avctx, AV_LOG_WARNING, "10 bit encode not supported\n");
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
@ -1420,8 +1420,8 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
|
|||
break;
|
||||
}
|
||||
|
||||
// force setting profile as main10 if input is 10 bit
|
||||
if (IS_10BIT(ctx->data_pix_fmt)) {
|
||||
// force setting profile as main10 if input is 10 bit or if it should be encoded as 10 bit
|
||||
if (IS_10BIT(ctx->data_pix_fmt) || ctx->highbitdepth) {
|
||||
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
|
||||
avctx->profile = AV_PROFILE_HEVC_MAIN_10;
|
||||
}
|
||||
|
@ -1435,8 +1435,8 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
|
|||
hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1;
|
||||
|
||||
#ifdef NVENC_HAVE_NEW_BIT_DEPTH_API
|
||||
hevc->inputBitDepth = hevc->outputBitDepth =
|
||||
IS_10BIT(ctx->data_pix_fmt) ? NV_ENC_BIT_DEPTH_10 : NV_ENC_BIT_DEPTH_8;
|
||||
hevc->inputBitDepth = IS_10BIT(ctx->data_pix_fmt) ? NV_ENC_BIT_DEPTH_10 : NV_ENC_BIT_DEPTH_8;
|
||||
hevc->outputBitDepth = (IS_10BIT(ctx->data_pix_fmt) || ctx->highbitdepth) ? NV_ENC_BIT_DEPTH_10 : NV_ENC_BIT_DEPTH_8;
|
||||
#else
|
||||
hevc->pixelBitDepthMinus8 = IS_10BIT(ctx->data_pix_fmt) ? 2 : 0;
|
||||
#endif
|
||||
|
|
|
@ -183,6 +183,9 @@ static const AVOption options[] = {
|
|||
{ "fullres", "Two Pass encoding is enabled where first Pass is full resolution",
|
||||
0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TWO_PASS_FULL_RESOLUTION }, 0, 0, VE, .unit = "multipass" },
|
||||
#endif
|
||||
#ifdef NVENC_HAVE_NEW_BIT_DEPTH_API
|
||||
{ "highbitdepth", "Enable 10 bit encode for 8 bit input",OFFSET(highbitdepth),AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
||||
#endif
|
||||
#ifdef NVENC_HAVE_LDKFS
|
||||
{ "ldkfs", "Low delay key frame scale; Specifies the Scene Change frame size increase allowed in case of single frame VBV and CBR",
|
||||
OFFSET(ldkfs), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UCHAR_MAX, VE },
|
||||
|
|
Loading…
Reference in New Issue