MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / update_context_with_frame_header

Function update_context_with_frame_header

libavcodec/av1dec.c:821–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819}
820
821static 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
851static const CodedBitstreamUnitType decompose_unit_types[] = {
852 AV1_OBU_FRAME,

Callers 1

av1_frame_allocFunction · 0.85

Calls 4

ff_set_dimensionsFunction · 0.85
av_reduceFunction · 0.85
av_cmp_qFunction · 0.85
ff_set_sarFunction · 0.85

Tested by

no test coverage detected