mirror of https://git.ffmpeg.org/ffmpeg.git
libx265: Add 4:2:2 support
It is also not final yet, so require -strict experimental. Requires a bump to version 17. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
parent
180e6b4806
commit
61a344916d
|
@ -4100,8 +4100,8 @@ enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &
|
||||||
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
|
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
|
||||||
die "ERROR: libx264 version must be >= 0.118."; }
|
die "ERROR: libx264 version must be >= 0.118."; }
|
||||||
enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
|
enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
|
||||||
{ check_cpp_condition x265.h "X265_BUILD >= 13" ||
|
{ check_cpp_condition x265.h "X265_BUILD >= 17" ||
|
||||||
die "ERROR: libx265 version must be >= 13."; }
|
die "ERROR: libx265 version must be >= 17."; }
|
||||||
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
|
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
|
||||||
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
|
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
|
||||||
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
|
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
|
||||||
|
|
|
@ -82,10 +82,9 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
|
||||||
int nnal;
|
int nnal;
|
||||||
|
|
||||||
if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
|
if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
|
||||||
!av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_w &&
|
!av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_w) {
|
||||||
!av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_h) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"4:4:4 support is not fully defined for HEVC yet. "
|
"4:2:2 and 4:4:4 support is not fully defined for HEVC yet. "
|
||||||
"Set -strict experimental to encode anyway.\n");
|
"Set -strict experimental to encode anyway.\n");
|
||||||
return AVERROR(ENOSYS);
|
return AVERROR(ENOSYS);
|
||||||
}
|
}
|
||||||
|
@ -134,6 +133,10 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
|
||||||
case AV_PIX_FMT_YUV420P10:
|
case AV_PIX_FMT_YUV420P10:
|
||||||
ctx->params->internalCsp = X265_CSP_I420;
|
ctx->params->internalCsp = X265_CSP_I420;
|
||||||
break;
|
break;
|
||||||
|
case AV_PIX_FMT_YUV422P:
|
||||||
|
case AV_PIX_FMT_YUV422P10:
|
||||||
|
ctx->params->internalCsp = X265_CSP_I422;
|
||||||
|
break;
|
||||||
case AV_PIX_FMT_YUV444P:
|
case AV_PIX_FMT_YUV444P:
|
||||||
case AV_PIX_FMT_YUV444P10:
|
case AV_PIX_FMT_YUV444P10:
|
||||||
ctx->params->internalCsp = X265_CSP_I444;
|
ctx->params->internalCsp = X265_CSP_I444;
|
||||||
|
@ -262,14 +265,17 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||||
|
|
||||||
static const enum AVPixelFormat x265_csp_eight[] = {
|
static const enum AVPixelFormat x265_csp_eight[] = {
|
||||||
AV_PIX_FMT_YUV420P,
|
AV_PIX_FMT_YUV420P,
|
||||||
|
AV_PIX_FMT_YUV422P,
|
||||||
AV_PIX_FMT_YUV444P,
|
AV_PIX_FMT_YUV444P,
|
||||||
AV_PIX_FMT_NONE
|
AV_PIX_FMT_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
static const enum AVPixelFormat x265_csp_twelve[] = {
|
static const enum AVPixelFormat x265_csp_twelve[] = {
|
||||||
AV_PIX_FMT_YUV420P,
|
AV_PIX_FMT_YUV420P,
|
||||||
|
AV_PIX_FMT_YUV422P,
|
||||||
AV_PIX_FMT_YUV444P,
|
AV_PIX_FMT_YUV444P,
|
||||||
AV_PIX_FMT_YUV420P10,
|
AV_PIX_FMT_YUV420P10,
|
||||||
|
AV_PIX_FMT_YUV422P10,
|
||||||
AV_PIX_FMT_YUV444P10,
|
AV_PIX_FMT_YUV444P10,
|
||||||
AV_PIX_FMT_NONE
|
AV_PIX_FMT_NONE
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue