Skip to content

Commit

Permalink
ffmpeg: support for 10bit HEIC
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 10, 2023
1 parent eb474cf commit b17f5c5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libheif/plugins/decoder_ffmpeg_hevc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ static struct heif_error hevc_decode(AVCodecContext* hevc_dec_ctx, AVFrame* hevc
return err;
}

if ((hevc_dec_ctx->pix_fmt == AV_PIX_FMT_YUV420P) || (hevc_dec_ctx->pix_fmt == AV_PIX_FMT_YUVJ420P)) //planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)

if ((hevc_dec_ctx->pix_fmt == AV_PIX_FMT_YUV420P) || (hevc_dec_ctx->pix_fmt == AV_PIX_FMT_YUVJ420P) || //planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
(hevc_dec_ctx->pix_fmt == AV_PIX_FMT_YUV420P10LE))
{
heif_error err;
err = heif_image_create(hevc_frame->width,
Expand All @@ -231,7 +233,7 @@ static struct heif_error hevc_decode(AVCodecContext* hevc_dec_ctx, AVFrame* hevc

for (int channel = 0; channel < nPlanes; channel++) {

int bpp = 8;
int bpp = (hevc_dec_ctx->pix_fmt == AV_PIX_FMT_YUV420P10LE) ? 10 : 8;
int stride = hevc_frame->linesize[channel];
const uint8_t* data = hevc_frame->data[channel];

Expand Down

0 comments on commit b17f5c5

Please sign in to comment.