This source file includes following definitions.
- enter
- descend
- ascend
- leaf
#include "libde265/encoder/algo/algo.h"
#include "libde265/encoder/encoder-context.h"
#include <stdarg.h>
#ifdef DE265_LOG_DEBUG
static int descendLevel = 0;
void Algo::enter()
{
if (logdebug_enabled(LogEncoder)) {
printf("%d",descendLevel+1);
for (int i=0;i<descendLevel+1;i++) { printf(" "); }
printf(":%s\n",name());
}
}
void Algo::descend(const enc_node* node, const char* option, ...)
{
if (logdebug_enabled(LogEncoder)) {
descendLevel++;
printf("%d ",descendLevel);
for (int i=0;i<descendLevel;i++) { printf(" "); }
va_list va;
va_start(va, option);
va_end(va);
fprintf(stdout, ">%s(", name());
vfprintf(stdout, option, va);
fprintf(stdout, ") %d;%d %dx%d %p\n",node->x,node->y,1<<node->log2Size,1<<node->log2Size,node);
}
}
void Algo::ascend(const enc_node* resultNode, const char* fmt, ...)
{
if (logdebug_enabled(LogEncoder)) {
if (fmt != NULL) {
printf("%d ",descendLevel);
for (int i=0;i<descendLevel;i++) { printf(" "); }
va_list va;
va_start(va, fmt);
va_end(va);
fprintf(stdout, "<%s(", name());
vfprintf(stdout, fmt, va);
fprintf(stdout, ") <- %p\n",resultNode);
}
descendLevel--;
}
}
void Algo::leaf(const enc_node* node, const char* option, ...)
{
if (logdebug_enabled(LogEncoder)) {
printf("%d ",descendLevel+1);
for (int i=0;i<descendLevel+1;i++) { printf(" "); }
va_list va;
va_start(va, option);
va_end(va);
fprintf(stdout, "%s(", name());
vfprintf(stdout, option, va);
fprintf(stdout, ") %d;%d %dx%d\n",node->x,node->y,1<<node->log2Size,1<<node->log2Size);
}
}
#endif