#include "global.h"
#include "memalloc.h"
#include "q_matrix.h"
#include "q_offsets.h"

Go to the source code of this file.
Defines | |
| #define | MAX_ITEMS_TO_PARSE 2000 |
Functions | |
| char * | GetConfigFileContent (char *Filename, int error_type) |
| void | InitOffsetParam () |
| void | allocate_QOffsets () |
| void | free_QOffsets () |
| int | CheckOffsetParameterName (char *s, int *type) |
| void | ParseQOffsetMatrix (char *buf, int bufsize) |
| void | Init_QOffsetMatrix () |
| void | CalculateOffsetParam () |
| void | CalculateOffset8Param () |
| void | SelectColorType (int colour_id) |
Variables | |
| int | offset4x4_check [6] = { 0, 0, 0, 0, 0, 0 } |
| int | offset8x8_check [6] = { 0, 0, 0, 0, 0, 0 } |
| static const char | OffsetType4x4 [15][24] |
| static const char | OffsetType8x8 [15][24] |
| int ***** | LevelOffset4x4Comp |
| int ***** | LevelOffset8x8Comp |
| int **** | ptLevelOffset4x4 |
| int **** | ptLevelOffset8x8 |
| int | AdaptRndWeight |
| int | AdaptRndCrWeight |
| short ** | OffsetList4x4input |
| short ** | OffsetList8x8input |
| short *** | OffsetList4x4 |
| short *** | OffsetList8x8 |
| const int | OffsetBits = 11 |
| static const short | Offset_intra_default_intra [16] |
| static const short | Offset_intra_default_chroma [16] |
| static const short | Offset_intra_default_inter [16] |
| static const short | Offset_inter_default [16] |
| static const short | Offset8_intra_default_intra [64] |
| static const short | Offset8_intra_default_chroma [64] |
| static const short | Offset8_intra_default_inter [64] |
| static const short | Offset8_inter_default [64] |
Definition in file q_offsets.c.
| void allocate_QOffsets | ( | ) |
Allocate Q matrix arrays.
Definition at line 159 of file q_offsets.c.
References InputParameters::AdaptRoundingFixed, get_mem2Dshort(), get_mem3Dshort(), get_mem5Dint(), and InputParameters::output.
Referenced by Init_QOffsetMatrix().

| void CalculateOffset8Param | ( | void | ) |
Calculate the quantisation offset parameters.
Definition at line 627 of file q_offsets.c.
References InputParameters::AdaptRoundingFixed, ImageParameters::bitdepth_chroma_qp_scale, ImageParameters::bitdepth_luma_qp_scale, ImageParameters::colour_plane_id, and ImageParameters::type.
Referenced by code_a_plane(), encode_one_slice(), and encode_one_slice_MBAFF().
| void CalculateOffsetParam | ( | void | ) |
Calculation of the quantization offset params at the frame level.
Definition at line 489 of file q_offsets.c.
References InputParameters::AdaptRndCrWFactor, InputParameters::AdaptRndWFactor, InputParameters::AdaptRoundingFixed, ImageParameters::bitdepth_chroma_qp_scale, ImageParameters::bitdepth_luma_qp_scale, ImageParameters::colour_plane_id, ImageParameters::nal_reference_idc, and ImageParameters::type.
Referenced by code_a_plane(), encode_one_slice(), and encode_one_slice_MBAFF().
| int CheckOffsetParameterName | ( | char * | s, | |
| int * | type | |||
| ) |
Check the parameter name.
| s | parameter name string | |
| type | 4x4 or 8x8 offset matrix type |
Definition at line 223 of file q_offsets.c.
Referenced by ParseQOffsetMatrix().
| void free_QOffsets | ( | void | ) |
Free Q matrix arrays.
Definition at line 188 of file q_offsets.c.
References InputParameters::AdaptRoundingFixed, free_mem2Dshort(), free_mem3Dshort(), and free_mem5Dint().
Referenced by free_global_buffers().

| void Init_QOffsetMatrix | ( | void | ) |
Initialise Q offset matrix values.
Now set up all offset params. This process could be reused if we wish to re-init offsets
Definition at line 386 of file q_offsets.c.
References allocate_QOffsets(), errortext, GetConfigFileContent(), InitOffsetParam(), InputParameters::OffsetMatrixPresentFlag, ParseQOffsetMatrix(), and InputParameters::QOffsetMatrixFile.
Referenced by init_encoder().

| void InitOffsetParam | ( | ) |
Intit quantization offset params.
Definition at line 428 of file q_offsets.c.
References InputParameters::AdaptRoundingFixed, InputParameters::OffsetMatrixPresentFlag, and InputParameters::output.
Referenced by Init_QOffsetMatrix().
| void ParseQOffsetMatrix | ( | char * | buf, | |
| int | bufsize | |||
| ) |
Parse the Q Offset Matrix values read from cfg file.
| buf | buffer to be parsed | |
| bufsize | buffer size of buffer |
Definition at line 259 of file q_offsets.c.
References CheckOffsetParameterName(), error(), errortext, and ET_SIZE.
Referenced by Init_QOffsetMatrix().

const short Offset8_inter_default[64] [static] |
Initial value:
{
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342
}
Definition at line 142 of file q_offsets.c.
const short Offset8_intra_default_chroma[64] [static] |
Initial value:
{
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682
}
Definition at line 120 of file q_offsets.c.
const short Offset8_intra_default_inter[64] [static] |
Initial value:
{
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342,
342, 342, 342, 342, 342, 342, 342, 342
}
Definition at line 131 of file q_offsets.c.
const short Offset8_intra_default_intra[64] [static] |
Initial value:
{
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682,
682, 682, 682, 682, 682, 682, 682, 682
}
Definition at line 109 of file q_offsets.c.
const short Offset_inter_default[16] [static] |
Initial value:
{
342, 342, 342, 342,
342, 342, 342, 342,
342, 342, 342, 342,
342, 342, 342, 342,
}
Definition at line 102 of file q_offsets.c.
const short Offset_intra_default_chroma[16] [static] |
Initial value:
{
682, 682, 682, 682,
682, 682, 682, 682,
682, 682, 682, 682,
682, 682, 682, 682
}
Definition at line 87 of file q_offsets.c.
const short Offset_intra_default_inter[16] [static] |
Initial value:
{
342, 342, 342, 342,
342, 342, 342, 342,
342, 342, 342, 342,
342, 342, 342, 342,
}
Definition at line 95 of file q_offsets.c.
const short Offset_intra_default_intra[16] [static] |
Initial value:
{
682, 682, 682, 682,
682, 682, 682, 682,
682, 682, 682, 682,
682, 682, 682, 682
}
Definition at line 80 of file q_offsets.c.
const char OffsetType4x4[15][24] [static] |
Initial value:
{
"INTRA4X4_LUMA_INTRA",
"INTRA4X4_CHROMAU_INTRA",
"INTRA4X4_CHROMAV_INTRA",
"INTRA4X4_LUMA_INTERP",
"INTRA4X4_CHROMAU_INTERP",
"INTRA4X4_CHROMAV_INTERP",
"INTRA4X4_LUMA_INTERB",
"INTRA4X4_CHROMAU_INTERB",
"INTRA4X4_CHROMAV_INTERB",
"INTER4X4_LUMA_INTERP",
"INTER4X4_CHROMAU_INTERP",
"INTER4X4_CHROMAV_INTERP",
"INTER4X4_LUMA_INTERB",
"INTER4X4_CHROMAU_INTERB",
"INTER4X4_CHROMAV_INTERB"
}
Definition at line 24 of file q_offsets.c.
const char OffsetType8x8[15][24] [static] |
Initial value:
{
"INTRA8X8_LUMA_INTRA",
"INTRA8X8_LUMA_INTERP",
"INTRA8X8_LUMA_INTERB",
"INTER8X8_LUMA_INTERP",
"INTER8X8_LUMA_INTERB",
"INTRA8X8_CHROMAU_INTRA",
"INTRA8X8_CHROMAU_INTERP",
"INTRA8X8_CHROMAU_INTERB",
"INTER8X8_CHROMAU_INTERP",
"INTER8X8_CHROMAU_INTERB",
"INTRA8X8_CHROMAV_INTRA",
"INTRA8X8_CHROMAV_INTERP",
"INTRA8X8_CHROMAV_INTERB",
"INTER8X8_CHROMAV_INTERP",
"INTER8X8_CHROMAV_INTERB"
}
Definition at line 42 of file q_offsets.c.