| 819 | } |
| 820 | |
| 821 | static int update_context_with_frame_header(AVCodecContext *avctx, |
| 822 | const AV1RawFrameHeader *header) |
| 823 | { |
| 824 | AVRational aspect_ratio; |
| 825 | int width = header->frame_width_minus_1 + 1; |
| 826 | int height = header->frame_height_minus_1 + 1; |
| 827 | int r_width = header->render_width_minus_1 + 1; |
| 828 | int r_height = header->render_height_minus_1 + 1; |
| 829 | int ret; |
| 830 | |
| 831 | if (avctx->width != width || avctx->height != height) { |
| 832 | ret = ff_set_dimensions(avctx, width, height); |
| 833 | if (ret < 0) |
| 834 | return ret; |
| 835 | } |
| 836 | |
| 837 | av_reduce(&aspect_ratio.num, &aspect_ratio.den, |
| 838 | (int64_t)height * r_width, |
| 839 | (int64_t)width * r_height, |
| 840 | INT_MAX); |
| 841 | |
| 842 | if (av_cmp_q(avctx->sample_aspect_ratio, aspect_ratio)) { |
| 843 | ret = ff_set_sar(avctx, aspect_ratio); |
| 844 | if (ret < 0) |
| 845 | return ret; |
| 846 | } |
| 847 | |
| 848 | return 0; |
| 849 | } |
| 850 | |
| 851 | static const CodedBitstreamUnitType decompose_unit_types[] = { |
| 852 | AV1_OBU_FRAME, |
no test coverage detected