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

Function recon_frame_process

tools/enc_recon_frame_test.c:106–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106static int recon_frame_process(PrivData *pd, const AVPacket *pkt)
107{
108 AVFrame *f = pd->frame_recon;
109 int ret;
110
111 ret = avcodec_receive_frame(pd->enc, f);
112 if (ret < 0) {
113 fprintf(stderr, "Error retrieving a reconstructed frame\n");
114 return ret;
115 }
116
117 // the encoder's internal format (in which the reconstructed frames are
118 // exported) may be different from the user-facing pixel format
119 if (f->format != pd->enc->pix_fmt) {
120 if (!pd->scaler) {
121 pd->scaler = sws_getContext(f->width, f->height, f->format,
122 f->width, f->height, pd->enc->pix_fmt,
123 SWS_BITEXACT, NULL, NULL, NULL);
124 if (!pd->scaler)
125 return AVERROR(ENOMEM);
126 }
127
128 ret = sws_scale_frame(pd->scaler, pd->frame, f);
129 if (ret < 0) {
130 fprintf(stderr, "Error converting pixel formats\n");
131 return ret;
132 }
133
134 av_frame_unref(f);
135 f = pd->frame;
136 }
137
138 ret = frame_hash(&pd->checksums_recon, &pd->nb_checksums_recon,
139 pkt->pts, f);
140 av_frame_unref(f);
141
142 return 0;
143}
144
145static int process_frame(DecodeContext *dc, AVFrame *frame)
146{

Callers 1

process_frameFunction · 0.85

Calls 5

avcodec_receive_frameFunction · 0.85
sws_getContextFunction · 0.85
sws_scale_frameFunction · 0.85
av_frame_unrefFunction · 0.85
frame_hashFunction · 0.85

Tested by

no test coverage detected