| 1664 | } |
| 1665 | |
| 1666 | static int update_frame_props(AVCodecContext *avctx, AVFrame *frame) |
| 1667 | { |
| 1668 | #if CONFIG_LIBLCEVC_DEC |
| 1669 | AVCodecInternal *avci = avctx->internal; |
| 1670 | DecodeContext *dc = decode_ctx(avci); |
| 1671 | |
| 1672 | dc->lcevc.frame = dc->lcevc.ctx && avctx->codec_type == AVMEDIA_TYPE_VIDEO && |
| 1673 | av_frame_get_side_data(frame, AV_FRAME_DATA_LCEVC); |
| 1674 | |
| 1675 | if (dc->lcevc.frame) { |
| 1676 | int ret = ff_lcevc_parse_frame(dc->lcevc.ctx, frame, |
| 1677 | &dc->lcevc.width, &dc->lcevc.height, avctx); |
| 1678 | if (ret < 0) |
| 1679 | return ret; |
| 1680 | |
| 1681 | // force get_buffer2() to allocate the base frame using the same dimensions |
| 1682 | // as the final enhanced frame, in order to prevent reinitializing the buffer |
| 1683 | // pools unnecessarely |
| 1684 | if (dc->lcevc.width && dc->lcevc.height) { |
| 1685 | dc->lcevc.base_width = frame->width; |
| 1686 | dc->lcevc.base_height = frame->height; |
| 1687 | frame->width = dc->lcevc.width; |
| 1688 | frame->height = dc->lcevc.height; |
| 1689 | } |
| 1690 | } |
| 1691 | #endif |
| 1692 | return 0; |
| 1693 | } |
| 1694 | |
| 1695 | static int attach_post_process_data(AVCodecContext *avctx, AVFrame *frame) |
| 1696 | { |
no test coverage detected