mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
Merge branch 'yuview_debugging'
This commit is contained in:
commit
2f7050382f
|
@ -266,6 +266,7 @@
|
|||
<ClCompile Include="..\..\src\strategies\avx2\alf-avx2.c">
|
||||
<Filter>Optimization\strategies\avx2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\debug.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\bitstream.h">
|
||||
|
@ -497,6 +498,7 @@
|
|||
<ClInclude Include="..\..\src\strategies\avx2\alf-avx2.h">
|
||||
<Filter>Optimization\strategies\avx2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\debug.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<YASM Include="..\..\src\extras\x86inc.asm">
|
||||
|
@ -509,4 +511,7 @@
|
|||
<Filter>Optimization\strategies\x86_asm</Filter>
|
||||
</YASM>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<ItemGroup>
|
||||
<None Include="ClassDiagram.cd" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -57,6 +57,8 @@ libkvazaar_la_SOURCES = \
|
|||
context.h \
|
||||
cu.c \
|
||||
cu.h \
|
||||
debug.c \
|
||||
debug.h \
|
||||
encoder.c \
|
||||
encoder.h \
|
||||
encoderstate.c \
|
||||
|
|
416
src/debug.c
Normal file
416
src/debug.c
Normal file
|
@ -0,0 +1,416 @@
|
|||
/*****************************************************************************
|
||||
* This file is part of uvg266 VVC encoder.
|
||||
*
|
||||
* Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Functions for debugging purposes.
|
||||
*/
|
||||
#include "global.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "encoderstate.h"
|
||||
#include "inter.h"
|
||||
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
|
||||
#define INITIAL_ALLOC 10000
|
||||
FILE* yuview_output;
|
||||
|
||||
struct yuview_data {
|
||||
int poc;
|
||||
int bytes_allocated[DBG_YUVIEW_NUM_ITEMS];
|
||||
int last_pos[DBG_YUVIEW_NUM_ITEMS];
|
||||
char* items[DBG_YUVIEW_NUM_ITEMS];
|
||||
};
|
||||
|
||||
struct yuview_data** yuview_frame_data;
|
||||
int yuview_frames;
|
||||
|
||||
static int yuview_find_poc(int poc) {
|
||||
for (int i = 0; i < yuview_frames; i++) {
|
||||
if (yuview_frame_data[i]->poc == poc) return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static void yuview_alloc_frame(int poc) {
|
||||
assert(yuview_frame_data != NULL);
|
||||
|
||||
yuview_frame_data = realloc(yuview_frame_data, (yuview_frames + 1) * sizeof(struct yuview_data*));
|
||||
|
||||
struct yuview_data* data = malloc(sizeof(struct yuview_data));
|
||||
|
||||
memset(data->last_pos, 0, sizeof(data->last_pos[0]) * DBG_YUVIEW_NUM_ITEMS);
|
||||
for (int i = 0; i < DBG_YUVIEW_NUM_ITEMS; i++) {
|
||||
data->bytes_allocated[i] = INITIAL_ALLOC;
|
||||
data->items[i] = malloc(INITIAL_ALLOC);
|
||||
}
|
||||
|
||||
data->poc = poc;
|
||||
|
||||
yuview_frame_data[yuview_frames] = data;
|
||||
|
||||
yuview_frames++;
|
||||
|
||||
}
|
||||
|
||||
void kvz_dbg_yuview_init(const encoder_control_t* const encoder, char* filename, char* sequence) {
|
||||
|
||||
char buf[100];
|
||||
snprintf(buf, 100, "%s.csv", filename);
|
||||
|
||||
yuview_output = fopen(buf, "wb");
|
||||
|
||||
yuview_frame_data = malloc(1);
|
||||
|
||||
yuview_frames = 0;
|
||||
|
||||
fprintf(yuview_output, "%%;syntax-version;v1.22\r\n");
|
||||
fprintf(yuview_output, "%%;seq-specs;%s;layer2;%d;%d;%f\r\n", sequence, encoder->in.width, encoder->in.height, encoder->cfg.framerate);
|
||||
fprintf(yuview_output, "%%;type;0;CU-type;range\r\n");
|
||||
fprintf(yuview_output, "%%;defaultRange;0;2;jet\r\n");
|
||||
fprintf(yuview_output, "%%;type;1;IntraDirLuma;range\r\n");
|
||||
fprintf(yuview_output, "%%;defaultRange;0;67;autumn\r\n");
|
||||
fprintf(yuview_output, "%%;type;2;IntraDirChroma;range\r\n");
|
||||
fprintf(yuview_output, "%%;defaultRange;0;67;autumn\r\n");
|
||||
fprintf(yuview_output, "%%;type;3;RefIdxSkipL0;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;4;0;65;75;154;160;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;type;4;RefIdxSkipL1;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;4;53;128;0;66;160;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;type;5;RefIdxMergeL0;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;4;75;154;160;255;0;65;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;type;6;RefIdxMergeL1;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;4;0;65;160;255;56;132;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;type;7;RefIdxInterL0;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;4;160;255;113;199;0;65;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;type;8;RefIdxInterL1;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;4;146;239;160;255;0;65;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;type;9;MVSkipL0;vector\r\n");
|
||||
fprintf(yuview_output, "%%;vectorColor;0;0;0;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
|
||||
fprintf(yuview_output, "%%;type;10;MVSkipL1;vector\r\n");
|
||||
fprintf(yuview_output, "%%;vectorColor;255;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
|
||||
fprintf(yuview_output, "%%;type;11;MVMergeL0;vector\r\n");
|
||||
fprintf(yuview_output, "%%;vectorColor;0;0;0;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
|
||||
fprintf(yuview_output, "%%;type;12;MVMergeL1;vector\r\n");
|
||||
fprintf(yuview_output, "%%;vectorColor;255;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
|
||||
fprintf(yuview_output, "%%;type;13;MVInterL0;vector\r\n");
|
||||
fprintf(yuview_output, "%%;vectorColor;0;0;0;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
|
||||
fprintf(yuview_output, "%%;type;14;MVInterL1;vector\r\n");
|
||||
fprintf(yuview_output, "%%;vectorColor;255;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleFactor;16\r\n");
|
||||
fprintf(yuview_output, "%%;type;15;NumSigCoeffY;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;1024;0;255;0;255;0;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleToBlockSize;1\r\n");
|
||||
fprintf(yuview_output, "%%;type;16;NumSigCoeffU;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;1024;0;255;0;255;0;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleToBlockSize;1\r\n");
|
||||
fprintf(yuview_output, "%%;type;17;NumSigCoeffV;range\r\n");
|
||||
fprintf(yuview_output, "%%;range;0;1024;0;255;0;255;0;255;255;255\r\n");
|
||||
fprintf(yuview_output, "%%;scaleToBlockSize;1\r\n");
|
||||
|
||||
}
|
||||
|
||||
static int yuview_check_allocated_memory(int poc, int type) {
|
||||
int idx = yuview_find_poc(poc);
|
||||
if (idx == -1) yuview_alloc_frame(poc);
|
||||
idx = yuview_frames - 1;
|
||||
|
||||
if (yuview_frame_data[idx]->bytes_allocated[type] - yuview_frame_data[idx]->last_pos[type] < 1000) {
|
||||
yuview_frame_data[idx]->items[type] = realloc(yuview_frame_data[idx]->items[type], yuview_frame_data[idx]->bytes_allocated[type] * 2);
|
||||
yuview_frame_data[idx]->bytes_allocated[type] *= 2;
|
||||
}
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
void kvz_dbg_yuview_add_vector(int poc, int x, int y, int width, int height, int type, int x_vec, int y_vec) {
|
||||
int idx = yuview_check_allocated_memory(poc, type);
|
||||
|
||||
char* buffer = &yuview_frame_data[idx]->items[type][ yuview_frame_data[idx]->last_pos[type] ];
|
||||
int space_left = yuview_frame_data[idx]->bytes_allocated[type] - yuview_frame_data[idx]->last_pos[type];
|
||||
|
||||
yuview_frame_data[idx]->last_pos[type] += snprintf(buffer, space_left,
|
||||
"%d;%d;%d;%d;%d;%d;%d;%d\r\n", poc, x, y, width, height, type, x_vec, y_vec);
|
||||
}
|
||||
|
||||
void kvz_dbg_yuview_add(int poc, int x, int y, int width, int height, int type, int val) {
|
||||
int idx = yuview_check_allocated_memory(poc, type);
|
||||
|
||||
char* buffer = &yuview_frame_data[idx]->items[type][ yuview_frame_data[idx]->last_pos[type] ];
|
||||
int space_left = yuview_frame_data[idx]->bytes_allocated[type] - yuview_frame_data[idx]->last_pos[type];
|
||||
|
||||
yuview_frame_data[idx]->last_pos[type] += snprintf(buffer, space_left,
|
||||
"%d;%d;%d;%d;%d;%d;%d\r\n", poc, x, y, width, height, type, val);
|
||||
}
|
||||
|
||||
void kvz_dbg_yuview_finish_frame(int poc) {
|
||||
|
||||
int idx = yuview_find_poc(poc);
|
||||
if (idx == -1) return;
|
||||
|
||||
struct yuview_data* data = yuview_frame_data[idx];
|
||||
|
||||
for (int i = 0; i < DBG_YUVIEW_NUM_ITEMS; i++) {
|
||||
if (data->last_pos[i] == 0) continue;
|
||||
data->items[i][data->last_pos[i]] = '\0';
|
||||
fprintf(yuview_output, "%s", data->items[i]);
|
||||
|
||||
free(data->items[i]);
|
||||
}
|
||||
free(yuview_frame_data[idx]);
|
||||
|
||||
for (int i = idx + 1; i < yuview_frames; i++) {
|
||||
yuview_frame_data[i - 1] = yuview_frame_data[i];
|
||||
}
|
||||
|
||||
yuview_frames--;
|
||||
}
|
||||
|
||||
void kvz_dbg_yuview_cleanup() {
|
||||
fclose(yuview_output);
|
||||
yuview_output = NULL;
|
||||
for (int idx = 0; idx < yuview_frames; idx++) {
|
||||
|
||||
struct yuview_data* data = yuview_frame_data[idx];
|
||||
|
||||
for (int i = 0; i < DBG_YUVIEW_NUM_ITEMS; i++) {
|
||||
free(data->items[i]);
|
||||
}
|
||||
free(yuview_frame_data[idx]);
|
||||
}
|
||||
|
||||
free(yuview_frame_data);
|
||||
}
|
||||
|
||||
#endif //KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
void kvz_dbg_encoder_state_dump_graphviz(const encoder_state_t* const state) {
|
||||
int i;
|
||||
|
||||
if (!state->parent) {
|
||||
const encoder_control_t* const encoder = state->encoder_control;
|
||||
int y, x;
|
||||
//Empty lines (easier to copy-paste)
|
||||
printf("\n\n\n\n\n");
|
||||
//Some styling...
|
||||
printf("digraph EncoderStates {\n");
|
||||
printf(" fontname = \"Bitstream Vera Sans\"\n");
|
||||
printf(" fontsize = 8\n\n");
|
||||
printf(" node [\n");
|
||||
printf(" fontname = \"Bitstream Vera Sans\"\n");
|
||||
printf(" fontsize = 8\n");
|
||||
printf(" shape = \"record\"\n");
|
||||
printf(" ]\n\n");
|
||||
printf(" edge [\n");
|
||||
printf(" arrowtail = \"empty\"\n");
|
||||
printf(" ]\n\n");
|
||||
|
||||
printf(" \"Map\" [\n");
|
||||
printf(" shape=plaintext\n");
|
||||
printf(" label = <<table cellborder=\"1\" cellspacing=\"0\" border=\"0\">");
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>RS Map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
|
||||
printf("<td>%d</td>", lcu_id_rs);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>TS Map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
const int lcu_id_ts = encoder->tiles_ctb_addr_rs_to_ts[lcu_id_rs];
|
||||
|
||||
printf("<td>%d</td>", lcu_id_ts);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>Tile map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
const int lcu_id_ts = encoder->tiles_ctb_addr_rs_to_ts[lcu_id_rs];
|
||||
|
||||
printf("<td>%d</td>", encoder->tiles_tile_id[lcu_id_ts]);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>Slice map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
const int lcu_id_ts = encoder->tiles_ctb_addr_rs_to_ts[lcu_id_rs];
|
||||
int slice_id = 0;
|
||||
|
||||
//Not efficient, but who cares
|
||||
for (i = 0; i < encoder->slice_count; ++i) {
|
||||
if (encoder->slice_addresses_in_ts[i] <= lcu_id_ts) {
|
||||
slice_id = i;
|
||||
}
|
||||
}
|
||||
|
||||
printf("<td>%d</td>", slice_id);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("</table>>\n ]\n");
|
||||
}
|
||||
|
||||
printf(" \"%p\" [\n", state);
|
||||
printf(" label = \"{encoder_state|");
|
||||
printf("+ type=%c\\l", state->type);
|
||||
if (!state->parent || state->frame != state->parent->global) {
|
||||
printf("|+ global\\l");
|
||||
}
|
||||
if (!state->parent || state->tile != state->parent->tile) {
|
||||
printf("|+ tile\\l");
|
||||
printf(" - id = %d\\l", state->tile->id);
|
||||
printf(" - lcu_offset_x = %d\\l", state->tile->lcu_offset_x);
|
||||
printf(" - lcu_offset_y = %d\\l", state->tile->lcu_offset_y);
|
||||
printf(" - lcu_offset_in_ts = %d\\l", state->tile->lcu_offset_in_ts);
|
||||
}
|
||||
if (!state->parent || state->slice != state->parent->slice) {
|
||||
printf("|+ slice\\l");
|
||||
printf(" - id = %d\\l", state->slice->id);
|
||||
printf(" - start_in_ts = %d\\l", state->slice->start_in_ts);
|
||||
printf(" - end_in_ts = %d\\l", state->slice->end_in_ts);
|
||||
printf(" - start_in_rs = %d\\l", state->slice->start_in_rs);
|
||||
printf(" - end_in_rs = %d\\l", state->slice->end_in_rs);
|
||||
}
|
||||
if (!state->parent || state->wfrow != state->parent->wfrow) {
|
||||
printf("|+ wfrow\\l");
|
||||
printf(" - lcu_offset_y = %d\\l", state->wfrow->lcu_offset_y);
|
||||
}
|
||||
printf("}\"\n");
|
||||
printf(" ]\n");
|
||||
|
||||
if (state->parent) {
|
||||
printf(" \"%p\" -> \"%p\"\n", state->parent, state);
|
||||
}
|
||||
|
||||
for (i = 0; state->children[i].encoder_control; ++i) {
|
||||
encoder_state_dump_graphviz(&state->children[i]);
|
||||
}
|
||||
|
||||
if (!state->parent) {
|
||||
printf("}\n");
|
||||
//Empty lines (easier to copy-paste)
|
||||
printf("\n\n\n\n\n");
|
||||
}
|
||||
}
|
||||
#endif //KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_MV_INFO
|
||||
static void lcu_from_cu_array(cu_array_t* src, int src_x, int src_y, lcu_t* dst)
|
||||
{
|
||||
// ToDo: Fix invalid memory access outside of src->data
|
||||
const int dst_stride = src->stride >> 2;
|
||||
for (int y = src_y ? -4 : 0; y < LCU_WIDTH; y += SCU_WIDTH) {
|
||||
for (int x = src_x ? -4 : 0; x < LCU_WIDTH; x += SCU_WIDTH) {
|
||||
const cu_info_t* to_cu = LCU_GET_CU_AT_PX(dst, x, y);
|
||||
const int x_scu = (src_x + x) >> 2;
|
||||
const int y_scu = (src_y + y) >> 2;
|
||||
cu_info_t* from_cu = &src->data[x_scu + y_scu * dst_stride];
|
||||
memcpy(to_cu, from_cu, sizeof(*to_cu));
|
||||
}
|
||||
}
|
||||
if (src_x) {
|
||||
const cu_info_t* to_cu = LCU_GET_CU_AT_PX(dst, -1, 64);
|
||||
const int x_scu = (src_x + -1) >> 2;
|
||||
const int y_scu = (src_y + 64) >> 2;
|
||||
cu_info_t* from_cu = &src->data[x_scu + y_scu * dst_stride];
|
||||
memcpy(to_cu, from_cu, sizeof(*to_cu));
|
||||
}
|
||||
if (src_y) {
|
||||
const cu_info_t* to_cu = LCU_GET_TOP_RIGHT_CU(dst);
|
||||
const int x_scu = (src_x + 64) >> 2;
|
||||
const int y_scu = (src_y + -1) >> 2;
|
||||
cu_info_t* from_cu = &src->data[x_scu + y_scu * dst_stride];
|
||||
memcpy(to_cu, from_cu, sizeof(*to_cu));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void kvz_print_merge_vectors(const encoder_state_t* const state, uint32_t pic_x, uint32_t pic_y, uint32_t block_width, uint32_t block_height, cu_info_t* cu) {
|
||||
|
||||
lcu_t lcu;
|
||||
lcu_from_cu_array(state->tile->frame->cu_array, pic_x - SUB_SCU(pic_x), pic_y - SUB_SCU(pic_y), &lcu);
|
||||
static int val = 0;
|
||||
inter_merge_cand_t merge_cand[MRG_MAX_NUM_CANDS] = { 0 };
|
||||
// Search for merge mode candidates
|
||||
uint8_t num_merge_cand = kvz_inter_get_merge_cand(state,
|
||||
pic_x, pic_y,
|
||||
block_width, block_height,
|
||||
true, true,
|
||||
merge_cand,
|
||||
&lcu
|
||||
);
|
||||
static FILE* lut = NULL;
|
||||
if (lut == NULL) lut = fopen("uvg_merge2.txt", "w");
|
||||
|
||||
|
||||
fprintf(lut, "%d: (%d,%d) Block (%d,%d) -> %d (", val++, pic_x, pic_y, block_width, block_height, cu->inter.mv_dir);
|
||||
|
||||
if (cu->inter.mv_dir & 1) fprintf(lut, "%d,%d ", cu->inter.mv[0][0], cu->inter.mv[0][1]);
|
||||
if (cu->inter.mv_dir & 2) fprintf(lut, "%d,%d ", cu->inter.mv[1][0], cu->inter.mv[1][1]);
|
||||
fprintf(lut, ") -> (");
|
||||
for (int i = 0; i < num_merge_cand; i++)
|
||||
{
|
||||
mv_t mv[2] = { merge_cand[i].mv[0][0], merge_cand[i].mv[0][1] };
|
||||
mv_t mv2[2] = { merge_cand[i].mv[1][0], merge_cand[i].mv[1][1] };
|
||||
//kvz_change_precision(4, 2, &mv[0], &mv[1]);
|
||||
fprintf(lut, "{ %d: ", merge_cand[i].dir);
|
||||
if (merge_cand[i].dir & 1) fprintf(lut, "%d,%d, ", mv[0], mv[1]);
|
||||
if (merge_cand[i].dir & 2) fprintf(lut, "%d,%d ", mv2[0], mv2[1]);
|
||||
fprintf(lut, "} ");
|
||||
}
|
||||
fprintf(lut, "%d, %d)\n", cu->merged | cu->skipped, (cu->merged | cu->skipped) ? cu->merge_idx : 0);
|
||||
}
|
||||
|
||||
#endif // KVZ_DEBUG_PRINT_MV_INFO
|
91
src/debug.h
Normal file
91
src/debug.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*****************************************************************************
|
||||
* This file is part of uvg266 VVC encoder.
|
||||
*
|
||||
* Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this
|
||||
* list of conditions and the following disclaimer in the documentation and/or
|
||||
* other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
|
||||
enum {
|
||||
DBG_YUVIEW_CU_TYPE = 0,
|
||||
DBG_YUVIEW_INTRADIR_LUMA = 1,
|
||||
DBG_YUVIEW_INTRADIR_CHROMA = 2,
|
||||
DBG_YUVIEW_REFIDX_SKIP_L0 = 3,
|
||||
DBG_YUVIEW_REFIDX_SKIP_L1 = 4,
|
||||
DBG_YUVIEW_REFIDX_MERGE_L0 = 5,
|
||||
DBG_YUVIEW_REFIDX_MERGE_L1 = 6,
|
||||
DBG_YUVIEW_REFIDX_INTER_L0 = 7,
|
||||
DBG_YUVIEW_REFIDX_INTER_L1 = 8,
|
||||
DBG_YUVIEW_MVSKIP_L0 = 9,
|
||||
DBG_YUVIEW_MVSKIP_L1 = 10,
|
||||
DBG_YUVIEW_MVMERGE_L0 = 11,
|
||||
DBG_YUVIEW_MVMERGE_L1 = 12,
|
||||
DBG_YUVIEW_MVINTER_L0 = 13,
|
||||
DBG_YUVIEW_MVINTER_L1 = 14,
|
||||
DBG_YUVIEW_NUM_SIG_COEFF_Y = 15,
|
||||
DBG_YUVIEW_NUM_SIG_COEFF_U = 16,
|
||||
DBG_YUVIEW_NUM_SIG_COEFF_V = 17,
|
||||
DBG_YUVIEW_NUM_ITEMS = 18,
|
||||
|
||||
};
|
||||
|
||||
typedef struct encoder_state_t encoder_state_t;
|
||||
typedef struct encoder_control_t encoder_control_t;
|
||||
|
||||
void kvz_dbg_yuview_init(const encoder_control_t* const encoder, char* filename, char* sequence);
|
||||
void kvz_dbg_yuview_add_vector(int poc, int x, int y, int width, int height, int type, int x_vec, int y_vec);
|
||||
void kvz_dbg_yuview_add(int poc, int x, int y, int width, int height, int type, int val);
|
||||
void kvz_dbg_yuview_finish_frame(int poc);
|
||||
void kvz_dbg_yuview_cleanup();
|
||||
|
||||
#define DBG_YUVIEW_INIT(_encoder, _filename, _sequence) kvz_dbg_yuview_init(_encoder, _filename, _sequence);
|
||||
#define DBG_YUVIEW_MV(_poc, _type, _x, _y, _width, _height, _x_vec, _y_vec) kvz_dbg_yuview_add_vector(_poc, _x, _y, _width, _height, _type, _x_vec, _y_vec);
|
||||
#define DBG_YUVIEW_VALUE(_poc, _type, _x, _y, _width, _height, _val) kvz_dbg_yuview_add(_poc, _x, _y, _width, _height, _type, _val);
|
||||
#define DBG_YUVIEW_FINISH_FRAME(_poc) kvz_dbg_yuview_finish_frame(_poc);
|
||||
#define DBG_YUVIEW_CLEANUP() kvz_dbg_yuview_cleanup();
|
||||
#else
|
||||
#define DBG_YUVIEW_INIT(_encoder, _filename, _sequence)
|
||||
#define DBG_YUVIEW_MV(_poc, _type, _x, _y, _width, _height, _x_vec, _y_vec)
|
||||
#define DBG_YUVIEW_VALUE(_poc, _type, _x, _y, _width, _height, _val)
|
||||
#define DBG_YUVIEW_FINISH_FRAME(_poc)
|
||||
#define DBG_YUVIEW_CLEANUP()
|
||||
#endif //KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
void kvz_dbg_encoder_state_dump_graphviz(const encoder_state_t* const state)
|
||||
#endif //KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_MV_INFO
|
||||
void kvz_print_merge_vectors(const encoder_state_t* const state, uint32_t pic_x, uint32_t pic_y, uint32_t block_width, uint32_t block_height, cu_info_t* cu);
|
||||
#define DBG_PRINT_MV(_state, _pic_x, _pic_y, _block_width, _block_height, _cu) kvz_print_merge_vectors(_state, _pic_x, _pic_y, _block_width, _block_height, _cu);
|
||||
#else
|
||||
#define DBG_PRINT_MV(_state, _pic_x, _pic_y, _block_width, _block_height, _cu)
|
||||
#endif // KVZ_DEBUG_PRINT_MV_INFO
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
#include "checkpoint.h"
|
||||
#include "cli.h"
|
||||
#include "debug.h"
|
||||
#include "encoder.h"
|
||||
#include "kvazaar.h"
|
||||
#include "kvazaar_internal.h"
|
||||
|
@ -549,6 +550,10 @@ int main(int argc, char *argv[])
|
|||
goto exit_failure;
|
||||
}
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
if (opts->debug != NULL) DBG_YUVIEW_INIT(encoder, opts->debug, opts->input);
|
||||
#endif
|
||||
|
||||
//Now, do the real stuff
|
||||
{
|
||||
|
||||
|
@ -709,6 +714,8 @@ int main(int argc, char *argv[])
|
|||
// Since chunks_out was not NULL, img_rec should have been set.
|
||||
assert(img_rec);
|
||||
|
||||
DBG_YUVIEW_FINISH_FRAME(info_out.poc);
|
||||
|
||||
// Move img_rec to the recon buffer.
|
||||
assert(recon_buffer_size < KVZ_MAX_GOP_LENGTH);
|
||||
recon_buffer[recon_buffer_size++] = img_rec;
|
||||
|
@ -819,6 +826,7 @@ done:
|
|||
if (output) fclose(output);
|
||||
if (recout) fclose(recout);
|
||||
|
||||
DBG_YUVIEW_CLEANUP();
|
||||
CHECKPOINTS_FINALIZE();
|
||||
|
||||
return retval;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "cabac.h"
|
||||
#include "context.h"
|
||||
#include "cu.h"
|
||||
#include "debug.h"
|
||||
#include "encoder.h"
|
||||
#include "global.h"
|
||||
#include "imagelist.h"
|
||||
|
@ -625,6 +626,12 @@ static bool encode_inter_prediction_unit(encoder_state_t * const state,
|
|||
if (symbol == 0) break;
|
||||
}
|
||||
}
|
||||
#ifdef KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
int abs_x = x + state->tile->offset_x;
|
||||
int abs_y = y + state->tile->offset_y;
|
||||
if (cur_cu->inter.mv_dir & 1) DBG_YUVIEW_MV(state->frame->poc, DBG_YUVIEW_MVMERGE_L0, abs_x, abs_y, width, height, cur_cu->inter.mv[0][0], cur_cu->inter.mv[0][1]);
|
||||
if (cur_cu->inter.mv_dir & 2) DBG_YUVIEW_MV(state->frame->poc, DBG_YUVIEW_MVMERGE_L1, abs_x, abs_y, width, height, cur_cu->inter.mv[1][0], cur_cu->inter.mv[1][1]);
|
||||
#endif
|
||||
} else {
|
||||
if (state->frame->slicetype == KVZ_SLICE_B) {
|
||||
// Code Inter Dir
|
||||
|
@ -640,13 +647,17 @@ static bool encode_inter_prediction_unit(encoder_state_t * const state,
|
|||
cabac->cur_ctx = &(cabac->ctx.inter_dir[5]);
|
||||
CABAC_BIN(cabac, (inter_dir == 2), "inter_pred_idc");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t ref_list_idx = 0; ref_list_idx < 2; ref_list_idx++) {
|
||||
if (!(cur_cu->inter.mv_dir & (1 << ref_list_idx))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
int abs_x = x + state->tile->offset_x;
|
||||
int abs_y = y + state->tile->offset_y;
|
||||
DBG_YUVIEW_MV(state->frame->poc, ref_list_idx ? DBG_YUVIEW_MVINTER_L1 : DBG_YUVIEW_MVINTER_L0, abs_x, abs_y, width, height, cur_cu->inter.mv[ref_list_idx][0], cur_cu->inter.mv[ref_list_idx][1]);
|
||||
#endif
|
||||
// size of the current reference index list (L0/L1)
|
||||
uint8_t ref_LX_size = state->frame->ref_LX_size[ref_list_idx];
|
||||
|
||||
|
@ -1277,6 +1288,8 @@ void kvz_encode_coding_tree(encoder_state_t * const state,
|
|||
// CABAC_BIN(cabac, 0, "split_transform_flag");
|
||||
}
|
||||
|
||||
DBG_YUVIEW_VALUE(state->frame->poc, DBG_YUVIEW_CU_TYPE, abs_x, abs_y, cu_width, cu_width, (cur_cu->type == CU_INTRA)?0:1);
|
||||
|
||||
if (ctrl->cfg.lossless) {
|
||||
cabac->cur_ctx = &cabac->ctx.cu_transquant_bypass;
|
||||
CABAC_BIN(cabac, 1, "cu_transquant_bypass_flag");
|
||||
|
@ -1298,7 +1311,7 @@ void kvz_encode_coding_tree(encoder_state_t * const state,
|
|||
CABAC_BIN(cabac, cur_cu->skipped, "SkipFlag");
|
||||
|
||||
if (cur_cu->skipped) {
|
||||
|
||||
DBG_PRINT_MV(state, x, y, (uint32_t)cu_width, (uint32_t)cu_width, cur_cu);
|
||||
kvz_hmvp_add_mv(state, x, y, (uint32_t)cu_width, (uint32_t)cu_width, cur_cu);
|
||||
int16_t num_cand = state->encoder_control->cfg.max_merge;
|
||||
if (num_cand > 1) {
|
||||
|
@ -1315,6 +1328,11 @@ void kvz_encode_coding_tree(encoder_state_t * const state,
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef KVZ_DEBUG_PRINT_YUVIEW_CSV
|
||||
if (cur_cu->inter.mv_dir & 1) DBG_YUVIEW_MV(state->frame->poc, DBG_YUVIEW_MVSKIP_L0, abs_x, abs_y, cu_width, cu_width, cur_cu->inter.mv[0][0], cur_cu->inter.mv[0][1]);
|
||||
if (cur_cu->inter.mv_dir & 2) DBG_YUVIEW_MV(state->frame->poc, DBG_YUVIEW_MVSKIP_L1, abs_x, abs_y, cu_width, cu_width, cur_cu->inter.mv[1][0], cur_cu->inter.mv[1][1]);
|
||||
#endif
|
||||
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@ -1394,7 +1412,7 @@ void kvz_encode_coding_tree(encoder_state_t * const state,
|
|||
const cu_info_t *cur_pu = kvz_cu_array_at_const(frame->cu_array, pu_x, pu_y);
|
||||
|
||||
non_zero_mvd |= encode_inter_prediction_unit(state, cabac, cur_pu, pu_x, pu_y, pu_w, pu_h, depth);
|
||||
|
||||
DBG_PRINT_MV(state, pu_x, pu_y, pu_w, pu_h, cur_pu);
|
||||
kvz_hmvp_add_mv(state, x, y, pu_w, pu_h, cur_pu);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "bitstream.h"
|
||||
#include "cabac.h"
|
||||
#include "cu.h"
|
||||
#include "debug.h"
|
||||
#include "encoder.h"
|
||||
#include "encoder_state-geometry.h"
|
||||
#include "encoderstate.h"
|
||||
|
@ -231,129 +232,6 @@ static int encoder_state_config_wfrow_init(encoder_state_t * const state,
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
static void encoder_state_dump_graphviz(const encoder_state_t * const state) {
|
||||
int i;
|
||||
|
||||
if (!state->parent) {
|
||||
const encoder_control_t * const encoder = state->encoder_control;
|
||||
int y,x;
|
||||
//Empty lines (easier to copy-paste)
|
||||
printf("\n\n\n\n\n");
|
||||
//Some styling...
|
||||
printf("digraph EncoderStates {\n");
|
||||
printf(" fontname = \"Bitstream Vera Sans\"\n");
|
||||
printf(" fontsize = 8\n\n");
|
||||
printf(" node [\n");
|
||||
printf(" fontname = \"Bitstream Vera Sans\"\n");
|
||||
printf(" fontsize = 8\n");
|
||||
printf(" shape = \"record\"\n");
|
||||
printf(" ]\n\n");
|
||||
printf(" edge [\n");
|
||||
printf(" arrowtail = \"empty\"\n");
|
||||
printf(" ]\n\n");
|
||||
|
||||
printf(" \"Map\" [\n");
|
||||
printf(" shape=plaintext\n");
|
||||
printf(" label = <<table cellborder=\"1\" cellspacing=\"0\" border=\"0\">");
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>RS Map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
|
||||
printf("<td>%d</td>", lcu_id_rs);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>TS Map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
const int lcu_id_ts = encoder->tiles_ctb_addr_rs_to_ts[lcu_id_rs];
|
||||
|
||||
printf("<td>%d</td>", lcu_id_ts);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>Tile map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
const int lcu_id_ts = encoder->tiles_ctb_addr_rs_to_ts[lcu_id_rs];
|
||||
|
||||
printf("<td>%d</td>", encoder->tiles_tile_id[lcu_id_ts]);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("<tr><td colspan=\"%d\" height=\"20\" valign=\"bottom\"><b>Slice map</b></td></tr>", encoder->in.width_in_lcu);
|
||||
for (y = 0; y < encoder->in.height_in_lcu; ++y) {
|
||||
printf("<tr>");
|
||||
for (x = 0; x < encoder->in.width_in_lcu; ++x) {
|
||||
const int lcu_id_rs = y * encoder->in.width_in_lcu + x;
|
||||
const int lcu_id_ts = encoder->tiles_ctb_addr_rs_to_ts[lcu_id_rs];
|
||||
int slice_id = 0;
|
||||
|
||||
//Not efficient, but who cares
|
||||
for (i=0; i < encoder->slice_count; ++i) {
|
||||
if (encoder->slice_addresses_in_ts[i] <= lcu_id_ts) {
|
||||
slice_id = i;
|
||||
}
|
||||
}
|
||||
|
||||
printf("<td>%d</td>", slice_id);
|
||||
}
|
||||
printf("</tr>");
|
||||
}
|
||||
printf("</table>>\n ]\n");
|
||||
}
|
||||
|
||||
printf(" \"%p\" [\n", state);
|
||||
printf(" label = \"{encoder_state|");
|
||||
printf("+ type=%c\\l", state->type);
|
||||
if (!state->parent || state->frame != state->parent->global) {
|
||||
printf("|+ global\\l");
|
||||
}
|
||||
if (!state->parent || state->tile != state->parent->tile) {
|
||||
printf("|+ tile\\l");
|
||||
printf(" - id = %d\\l", state->tile->id);
|
||||
printf(" - lcu_offset_x = %d\\l", state->tile->lcu_offset_x);
|
||||
printf(" - lcu_offset_y = %d\\l", state->tile->lcu_offset_y);
|
||||
printf(" - lcu_offset_in_ts = %d\\l", state->tile->lcu_offset_in_ts);
|
||||
}
|
||||
if (!state->parent || state->slice != state->parent->slice) {
|
||||
printf("|+ slice\\l");
|
||||
printf(" - id = %d\\l", state->slice->id);
|
||||
printf(" - start_in_ts = %d\\l", state->slice->start_in_ts);
|
||||
printf(" - end_in_ts = %d\\l", state->slice->end_in_ts);
|
||||
printf(" - start_in_rs = %d\\l", state->slice->start_in_rs);
|
||||
printf(" - end_in_rs = %d\\l", state->slice->end_in_rs);
|
||||
}
|
||||
if (!state->parent || state->wfrow != state->parent->wfrow) {
|
||||
printf("|+ wfrow\\l");
|
||||
printf(" - lcu_offset_y = %d\\l", state->wfrow->lcu_offset_y);
|
||||
}
|
||||
printf("}\"\n");
|
||||
printf(" ]\n");
|
||||
|
||||
if (state->parent) {
|
||||
printf(" \"%p\" -> \"%p\"\n", state->parent, state);
|
||||
}
|
||||
|
||||
for (i = 0; state->children[i].encoder_control; ++i) {
|
||||
encoder_state_dump_graphviz(&state->children[i]);
|
||||
}
|
||||
|
||||
if (!state->parent) {
|
||||
printf("}\n");
|
||||
//Empty lines (easier to copy-paste)
|
||||
printf("\n\n\n\n\n");
|
||||
}
|
||||
}
|
||||
#endif //KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
|
||||
/**
|
||||
* \brief Initializer for main thread related things
|
||||
mostly arrays that are only needed one per frame
|
||||
|
@ -800,7 +678,7 @@ int kvz_encoder_state_init(encoder_state_t * const child_state, encoder_state_t
|
|||
}
|
||||
|
||||
#ifdef KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
if (!parent_state) encoder_state_dump_graphviz(child_state);
|
||||
if (!parent_state) kvz_dbg_encoder_state_dump_graphviz(child_state);
|
||||
#endif //KVZ_DEBUG_PRINT_THREADING_INFO
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -62,9 +62,6 @@
|
|||
#include <string.h>
|
||||
|
||||
|
||||
// VVC related definitions
|
||||
#define ENABLE_WPP_PARALLELISM 0
|
||||
|
||||
//LMCS
|
||||
#define PIC_CODE_CW_BINS 16
|
||||
#define PIC_ANALYZE_CW_BINS 32
|
||||
|
@ -133,6 +130,8 @@ typedef int16_t mv_t;
|
|||
//#define KVZ_DEBUG_PRINT_CABAC 1
|
||||
//#define KVZ_DEBUG 1
|
||||
|
||||
//#define KVZ_DEBUG_PRINT_YUVIEW_CSV 1
|
||||
|
||||
/* CONFIG VARIABLES */
|
||||
|
||||
//spec: references to variables defined in Rec. ITU-T H.265 (04/2013)
|
||||
|
|
|
@ -1690,14 +1690,14 @@ uint8_t kvz_inter_get_merge_cand(const encoder_state_t * const state,
|
|||
// the temporal merge candidate.
|
||||
state->frame->ref_LX[0][0],
|
||||
temporal_cand,
|
||||
0,
|
||||
reflist,
|
||||
mv_cand[candidates].mv[reflist])) {
|
||||
mv_cand[candidates].ref[reflist] = 0;
|
||||
mv_cand[candidates].dir |= (1 << reflist);
|
||||
|
||||
if (reflist) {
|
||||
mv_cand[candidates].mv[1][0] *= -1;
|
||||
mv_cand[candidates].mv[1][1] *= -1;
|
||||
if (state->frame->ref->pocs[state->frame->ref_LX[reflist][0]] > state->frame->poc) {
|
||||
mv_cand[candidates].mv[reflist][0] *= -1;
|
||||
mv_cand[candidates].mv[reflist][1] *= -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,18 +129,6 @@ void kvz_encode_coeff_nxn_generic(encoder_state_t * const state,
|
|||
int32_t cg_pos_y = cg_blk_pos / (MIN((uint8_t)32, width) >> (log2_cg_size / 2));
|
||||
int32_t cg_pos_x = cg_blk_pos - (cg_pos_y * (MIN((uint8_t)32, width) >> (log2_cg_size / 2)));
|
||||
|
||||
|
||||
/*if (type == 0 && width <= 32) {
|
||||
if ((width == 32 && (cg_pos_x >= (16 >> clipped_log2_size))) || (width == 32 && (cg_pos_y >= (16 >> clipped_log2_size)))) {
|
||||
continue;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// !!! residual_coding_subblock() !!!
|
||||
|
||||
// Encode significant coeff group flag when not the last or the first
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#ifndef THREADQUEUE_H_
|
||||
#define THREADQUEUE_H_
|
||||
/*****************************************************************************
|
||||
* This file is part of uvg266 VVC encoder.
|
||||
*
|
||||
|
@ -31,6 +29,7 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
****************************************************************************/
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* \ingroup Threading
|
||||
|
@ -59,5 +58,3 @@ void kvz_threadqueue_free_job(threadqueue_job_t **job_ptr);
|
|||
int kvz_threadqueue_waitfor(threadqueue_queue_t * threadqueue, threadqueue_job_t * job);
|
||||
int kvz_threadqueue_stop(threadqueue_queue_t * threadqueue);
|
||||
void kvz_threadqueue_free(threadqueue_queue_t * threadqueue);
|
||||
|
||||
#endif // THREADQUEUE_H_
|
||||
|
|
Loading…
Reference in a new issue