Unified · Split
| @@ -49,6 +49,9 @@ · 48 unmodified lines | ||
| 49 | 49 | #include "libavutil/opt.h" |
| 50 | 50 | #include "libavutil/pixdesc.h" |
| 51 | 51 | |
| 52 | +#define IS_VP9(avctx) (CONFIG_LIBVPX_VP9_ENCODER && avctx->codec_id == AV_CODEC_ID_VP9) | |
| 53 | +#define IS_VP8(avctx) (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8) | |
| 54 | + | |
| 52 | 55 | /** |
| 53 | 56 | * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h. |
| 54 | 57 | * One encoded frame returned from the library. |
| @@ -359,8 +362,7 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo, · 304 unmodified lines | ||
| 359 | 362 | FrameData fd = { .pts = frame->pts }; |
| 360 | 363 | int ret; |
| 361 | 364 | |
| 362 | −#if CONFIG_LIBVPX_VP9_ENCODER | |
| 363 | − if (avctx->codec_id == AV_CODEC_ID_VP9 && | |
| 365 | + if (IS_VP9(avctx) && | |
| 364 | 366 | // Keep HDR10+ if it has bit depth higher than 8 and |
| 365 | 367 | // it has PQ trc (SMPTE2084). |
| 366 | 368 | enccfg->g_bit_depth > 8 && avctx->color_trc == AVCOL_TRC_SMPTE2084) { |
| @@ -372,7 +374,6 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo, · 5 unmodified lines | ||
| 372 | 374 | return AVERROR(ENOMEM); |
| 373 | 375 | } |
| 374 | 376 | } |
| 375 | −#endif | |
| 376 | 377 | |
| 377 | 378 | fd.duration = frame->duration; |
| 378 | 379 | fd.frame_opaque = frame->opaque; |