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

Function process_frame

tools/venc_data_dump.c:34–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include "libavcodec/avcodec.h"
33
34static int process_frame(DecodeContext *dc, AVFrame *frame)
35{
36 AVFrameSideData *sd;
37
38 if (!frame)
39 return 0;
40
41 fprintf(stdout, "frame %"PRId64"\n", dc->decoder->frame_num - 1);
42
43 sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS);
44 if (sd) {
45 AVVideoEncParams *par = (AVVideoEncParams*)sd->data;
46
47 fprintf(stdout, "AVVideoEncParams %d\n", par->type);
48 fprintf(stdout, "qp %d\n", par->qp);
49 for (int i = 0; i < FF_ARRAY_ELEMS(par->delta_qp); i++)
50 for (int j = 0; j < FF_ARRAY_ELEMS(par->delta_qp[i]); j++) {
51 if (par->delta_qp[i][j])
52 fprintf(stdout, "delta_qp[%d][%d] %"PRId32"\n", i, j, par->delta_qp[i][j]);
53 }
54
55 if (par->nb_blocks) {
56 fprintf(stdout, "nb_blocks %d\n", par->nb_blocks);
57 for (int i = 0; i < par->nb_blocks; i++) {
58 AVVideoBlockParams *b = av_video_enc_params_block(par, i);
59
60 fprintf(stdout, "block %d %d:%d %dx%d %"PRId32"\n",
61 i, b->src_x, b->src_y, b->w, b->h, b->delta_qp);
62 }
63 }
64 }
65
66 return 0;
67}
68
69int main(int argc, char **argv)
70{

Callers

nothing calls this directly

Calls 1

av_frame_get_side_dataFunction · 0.85

Tested by

no test coverage detected