Duck TrueMotion v1 Video Decoder by Alex Beregszaszi and Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t)
More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avcodec.h"
#include "internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "truemotion1data.h"
|
|
#define | FLAG_SPRITE 32 |
| |
|
#define | FLAG_KEYFRAME 16 |
| |
|
#define | FLAG_INTERFRAME 8 |
| |
|
#define | FLAG_INTERPOLATED 4 |
| |
|
#define | ALGO_NOP 0 |
| |
|
#define | ALGO_RGB16V 1 |
| |
|
#define | ALGO_RGB16H 2 |
| |
|
#define | ALGO_RGB24H 3 |
| |
|
#define | BLOCK_2x2 0 |
| |
|
#define | BLOCK_2x4 1 |
| |
|
#define | BLOCK_4x2 2 |
| |
|
#define | BLOCK_4x4 3 |
| |
| #define | GET_NEXT_INDEX() |
| |
| #define | INC_INDEX |
| |
| #define | APPLY_C_PREDICTOR() |
| |
| #define | APPLY_C_PREDICTOR_24() |
| |
| #define | APPLY_Y_PREDICTOR() |
| |
| #define | APPLY_Y_PREDICTOR_24() |
| |
| #define | OUTPUT_PIXEL_PAIR() |
| |
Duck TrueMotion v1 Video Decoder by Alex Beregszaszi and Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t)
The TrueMotion v1 decoder presently only decodes 16-bit TM1 data and outputs RGB555 (or RGB565) data. 24-bit TM1 data is not supported yet.
§ APPLY_C_PREDICTOR
| #define APPLY_C_PREDICTOR |
( |
| ) |
|
Value:predictor_pair = s->c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
GET_NEXT_INDEX() \
if (!index) { \
GET_NEXT_INDEX() \
predictor_pair = s->c_predictor_table[index]; \
horiz_pred += ((predictor_pair >> 1) * 5); \
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
INC_INDEX; \
} \
} else \
INC_INDEX;
§ APPLY_C_PREDICTOR_24
| #define APPLY_C_PREDICTOR_24 |
( |
| ) |
|
Value:predictor_pair = s->c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
GET_NEXT_INDEX() \
if (!index) { \
GET_NEXT_INDEX() \
predictor_pair = s->fat_c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
INC_INDEX; \
} \
} else \
INC_INDEX;
§ APPLY_Y_PREDICTOR
| #define APPLY_Y_PREDICTOR |
( |
| ) |
|
Value:predictor_pair = s->y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
GET_NEXT_INDEX() \
if (!index) { \
GET_NEXT_INDEX() \
predictor_pair = s->y_predictor_table[index]; \
horiz_pred += ((predictor_pair >> 1) * 5); \
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
INC_INDEX; \
} \
} else \
INC_INDEX;
§ APPLY_Y_PREDICTOR_24
| #define APPLY_Y_PREDICTOR_24 |
( |
| ) |
|
Value:predictor_pair = s->y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
GET_NEXT_INDEX() \
if (!index) { \
GET_NEXT_INDEX() \
predictor_pair = s->fat_y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
INC_INDEX; \
} \
} else \
INC_INDEX;
§ GET_NEXT_INDEX
| #define GET_NEXT_INDEX |
( |
| ) |
|
Value:{\
if (index_stream_index >= s->index_stream_size) { \
av_log(s->avctx,
AV_LOG_INFO,
" help! truemotion1 decoder went out of bounds\n"); \
return; \
} \
index = s->index_stream[index_stream_index++] * 4; \
}
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
§ INC_INDEX
Value:do { \
if (index >= 1023) { \
return; \
} \
index++; \
} while (0)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
§ OUTPUT_PIXEL_PAIR
| #define OUTPUT_PIXEL_PAIR |
( |
| ) |
|
Value:*current_pixel_pair = *vert_pred + horiz_pred; \
*vert_pred++ = *current_pixel_pair++;
§ ff_truemotion1_decoder
Initial value:= {
.name = "truemotion1",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_TRUEMOTION1,
.init = truemotion1_decode_init,
.close = truemotion1_decode_end,
.decode = truemotion1_decode_frame,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
Definition: truemotion1.c:45
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959