#include "avcodec.h"
#include "dsputil.h"
-#define printf(...) {} //(f)printf() usage is forbidden in libavcodec, use av_log
-#define fprintf(...) {}
-
#include "truemotion1data.h"
typedef struct TrueMotion1Context {
header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
if (s->buf[0] < 0x10)
{
- printf("invalid header size\n");
+ av_log(s->avctx, AV_LOG_ERROR, "invalid header size\n");
return -1;
}
}
if (header.compression > 17) {
- printf("invalid compression type (%d)\n", header.compression);
+ av_log(s->avctx, AV_LOG_ERROR, "invalid compression type (%d)\n", header.compression);
return -1;
}
if (header.vectable < 4)
sel_vector_table = tables[header.vectable - 1];
else {
- printf("invalid vector table id (%d)\n", header.vectable);
+ av_log(s->avctx, AV_LOG_ERROR, "invalid vector table id (%d)\n", header.vectable);
return -1;
}
}
{
if (compression_types[header.compression].algorithm == ALGO_RGB24H)
{
- printf("24bit compression not yet supported\n");
+ av_log(s->avctx, AV_LOG_ERROR, "24bit compression not yet supported\n");
}
else
gen_vector_table(s, sel_vector_table);
#define GET_NEXT_INDEX() \
{\
if (index_stream_index >= s->index_stream_size) { \
- printf (" help! truemotion1 decoder went out of bounds\n"); \
+ av_log(s->avctx, AV_LOG_INFO, " help! truemotion1 decoder went out of bounds\n"); \
return; \
} \
index = s->index_stream[index_stream_index++] * 4; \
s->frame.reference = 1;
if (avctx->get_buffer(avctx, &s->frame) < 0) {
- fprintf(stderr, "truemotion1: get_buffer() failed\n");
+ av_log(s->avctx, AV_LOG_ERROR, "truemotion1: get_buffer() failed\n");
return -1;
}
if (buf_size == 0)
return 0;
- *data_size = 0;
-
if (truemotion1_decode_header(s) == -1)
return -1;
memcpy(s->frame.data[0], s->prev_frame.data[0],
s->frame.linesize[0] * s->avctx->height);
} else if (compression_types[s->compression].algorithm == ALGO_RGB24H) {
- printf (" 24-bit Duck TrueMotion decoding not yet implemented\n");
+ av_log(s->avctx, AV_LOG_ERROR, "24bit compression not yet supported\n");
} else {
truemotion1_decode_16bit(s);
}