33#ifndef AVCODEC_QPFILE_PARSER_H
34#define AVCODEC_QPFILE_PARSER_H
39#define QPFILE_DELTA_MIN (-12)
40#define QPFILE_DELTA_MAX (12)
41#define QPFILE_LUT_SIZE (QPFILE_DELTA_MAX - QPFILE_DELTA_MIN + 1)
66 unsigned frame_index);
70 unsigned max_segments);
78 unsigned max_segments);
unsigned ff_qpfile_palette(const int8_t *vals, size_t n, int *seg_values, unsigned max_segments)
Fill seg_values, ascending, with each distinct value of the n offsets in vals when there are at most ...
int ff_qpfile_load(void *log_ctx, const char *path, FFQpFile *out)
Load a per-frame QP-offset file into out, logging errors to log_ctx.
const FFQpFrame * ff_qpfile_frame_for_index(const FFQpFile *qf, unsigned frame_index)
Look up the QP frame record matching or preceding the given frame index.
unsigned ff_qpfile_segment_values(const FFQpFrame *qf, int *seg_values, unsigned max_segments)
Fill seg_values with the palette (see ff_qpfile_palette) of the frame's block offsets,...
void ff_qpfile_segment_lut(uint8_t *lut, const int *seg_values, unsigned n_seg)
Fill lut[QPFILE_LUT_SIZE] with the nearest segment index of each offset from QPFILE_DELTA_MIN to QPFI...
int ff_qpfile_check_grid(void *log_ctx, const char *encoder, const FFQpFile *qf, int width, int height)
Verify that the QP file grid matches the video macroblock dimensions.
void ff_qpfile_free(FFQpFile *qpf)
Free all memory allocated inside an FFQpFile structure.
unsigned ff_qpfile_nearest_segment(int v, const int *seg_values, unsigned n_seg)
Return the index of the segment value nearest v, the first one on a tie.