uvg266/src/debug.h

76 lines
3.6 KiB
C
Raw Normal View History

/*****************************************************************************
* 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_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,
};
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(const encoder_state_t* const state, int x, int y, int width, int height, int type, int x_vec, int y_vec);
void kvz_dbg_yuview_add(const encoder_state_t* const state, int x, int y, int width, int height, int type, int val);
void kvz_dbg_yuview_cleanup();
#define DBG_YUVIEW_INIT(_encoder, _filename, _sequence) kvz_dbg_yuview_init(_encoder, _filename, _sequence);
#define DBG_YUVIEW_MV(_type, _x, _y, _width, _height, _x_vec, _y_vec) kvz_dbg_yuview_add_vector(state, _type, _x, _y, _width, _height, _x_vec, _y_vec);
#define DBG_YUVIEW_CLEANUP() kvz_dbg_yuview_cleanup();
#else
#define DBG_YUVIEW_INIT(_filename, _sequence)
#define DBG_YUVIEW_MV(_type, _x, _y, _width, _height, _x_vec, _y_vec)
#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