26 #define BITSTREAM_READER_LE
53 uint8_t header_buffer[128] = { 0 };
56 header_size = ((s->
buf[0] >> 5) | (s->
buf[0] << 3)) & 0x7f;
57 if (header_size < 10) {
62 if (header_size + 1 > s->
size) {
68 for (i = 1; i < header_size; i++)
69 header_buffer[i - 1] = s->
buf[i] ^ s->
buf[i + 1];
72 s->
hscale = 1 + !!header_buffer[3];
83 1, -1, 2, -3, 8, -8, 18, -18, 36, -36, 54, -54, 96, -96, 144, -144
87 2, -3, 8, -8, 18, -18, 36, -36
99 void *
data,
int *got_frame,
104 int ret, buf_size = avpkt->
size;
108 int x, y, delta_mode;
125 for (y = 0; y < avctx->
height; y++) {
129 dst[x] = av_clip_uint8((y ? dst[x - p->
linesize[0]] : 0) + diff);
136 for (y = 0; y < avctx->
height; y++) {
145 for (y = 0; y < avctx->
height; y++) {
146 for (x = 0; x < avctx->
width; x++)
147 dst[x] = av_clip_uint8(dst[x] + (dst[x] - 128) / 3);
152 for (y = 0; y < avctx->
height >> 2; y++) {
154 for (x = 0; x < avctx->
width >> 2; x += s->
hscale) {
156 dst[x] = av_clip_uint8((y ? dst[x - p->
linesize[1]] : 128) + diff);
163 for (y = 0; y < avctx->
height >> 2; y++) {
164 for (x = 1; x < avctx->
width >> 2; x += s->
hscale) {
172 for (y = 0; y < avctx->
height >> 2; y++) {
173 for (x = 0; x < avctx->
width >> 2; x++)
174 dst[x] += (dst[x] - 128) / 8;
179 for (y = 0; y < avctx->
height >> 2; y++) {
181 for (x = 0; x < avctx->
width >> 2; x += s->
hscale) {
183 dst[x] = av_clip_uint8((y ? dst[x - p->
linesize[2]] : 128) + diff);
190 for (y = 0; y < avctx->
height >> 2; y++) {
191 for (x = 1; x < avctx->
width >> 2; x += s->
hscale) {
199 for (y = 0; y < avctx->
height >> 2; y++) {
200 for (x = 0; x < avctx->
width >> 2; x++)
201 dst[x] += (dst[x] - 128) / 8;
213 .
name =
"truemotion2rt",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
memory handling functions
static av_cold int init(AVCodecContext *avctx)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
static const int16_t *const delta_tabs[]
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
bitstream reader API header.
static const int16_t delta_tab2[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVCodec ff_truemotion2rt_decoder
const char * name
Name of the codec implementation.
common internal API header
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
static av_cold int decode_init(AVCodecContext *avctx)
static const int16_t delta_tab4[]
static const int16_t delta_tab3[]
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static void skip_bits(GetBitContext *s, int n)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
common internal api header.
static av_always_inline int diff(const uint32_t a, const uint32_t b)
static int truemotion2rt_decode_header(AVCodecContext *avctx)
int key_frame
1 -> keyframe, 0-> not
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.