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