You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/libx264: use the pixfmt descriptor to check for high bit depths
The x264_bit_depth constant has been removed in newer x264 builds. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -272,6 +272,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
|||||||
int *got_packet)
|
int *got_packet)
|
||||||
{
|
{
|
||||||
X264Context *x4 = ctx->priv_data;
|
X264Context *x4 = ctx->priv_data;
|
||||||
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(ctx->pix_fmt);
|
||||||
x264_nal_t *nal;
|
x264_nal_t *nal;
|
||||||
int nnal, i, ret;
|
int nnal, i, ret;
|
||||||
x264_picture_t pic_out = {0};
|
x264_picture_t pic_out = {0};
|
||||||
@@ -279,7 +280,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
|||||||
|
|
||||||
x264_picture_init( &x4->pic );
|
x264_picture_init( &x4->pic );
|
||||||
x4->pic.img.i_csp = x4->params.i_csp;
|
x4->pic.img.i_csp = x4->params.i_csp;
|
||||||
if (x264_bit_depth > 8)
|
if (desc->comp[0].depth > 8)
|
||||||
x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
|
x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
|
||||||
x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
|
x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user