FFmpeg
Classes | Macros | Typedefs | Enumerations | Variables
indeo3.c File Reference

This is a decoder for Intel Indeo Video v3. More...

#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "copy_block.h"
#include "bytestream.h"
#include "get_bits.h"
#include "hpeldsp.h"
#include "internal.h"
#include "indeo3data.h"

Classes

struct  Plane
 
struct  Cell
 
struct  Indeo3DecodeContext
 

Macros

#define BS_8BIT_PEL   (1 << 1)
 8-bit pixel bitdepth indicator
 
#define BS_KEYFRAME   (1 << 2)
 intra frame indicator
 
#define BS_MV_Y_HALF   (1 << 4)
 vertical mv halfpel resolution indicator
 
#define BS_MV_X_HALF   (1 << 5)
 horizontal mv halfpel resolution indicator
 
#define BS_NONREF   (1 << 8)
 nonref (discardable) frame indicator
 
#define BS_BUFFER   9
 indicates which of two frame buffers should be used
 
#define CELL_STACK_MAX   20
 
#define AVG_32(dst, src, ref)   AV_WN32A(dst, ((AV_RN32(src) + AV_RN32(ref)) >> 1) & 0x7F7F7F7FUL)
 
#define AVG_64(dst, src, ref)   AV_WN64A(dst, ((AV_RN64(src) + AV_RN64(ref)) >> 1) & 0x7F7F7F7F7F7F7F7FULL)
 
#define BUFFER_PRECHECK
 
#define RLE_BLOCK_COPY
 
#define RLE_BLOCK_COPY_8
 
#define RLE_LINES_COPY   copy_block4(dst, ref, row_offset, row_offset, num_lines << v_zoom)
 
#define RLE_LINES_COPY_M10
 
#define APPLY_DELTA_4
 
#define APPLY_DELTA_8
 
#define APPLY_DELTA_1011_INTER
 
#define SPLIT_CELL(size, new_size)   (new_size) = ((size) > 2) ? ((((size) + 2) >> 2) << 1) : 1
 
#define UPDATE_BITPOS(n)
 
#define RESYNC_BITSTREAM
 
#define CHECK_CELL
 
#define OS_HDR_ID   MKBETAG('F', 'R', 'M', 'H')
 

Typedefs

typedef struct Plane Plane
 
typedef struct Cell Cell
 
typedef struct Indeo3DecodeContext Indeo3DecodeContext
 

Enumerations

enum  {
  RLE_ESC_F9 = 249, RLE_ESC_FA = 250, RLE_ESC_FB = 251, RLE_ESC_FC = 252,
  RLE_ESC_FD = 253, RLE_ESC_FE = 254, RLE_ESC_FF = 255
}
 
enum  {
  IV3_NOERR = 0, IV3_BAD_RLE = 1, IV3_BAD_DATA = 2, IV3_BAD_COUNTER = 3,
  IV3_UNSUPPORTED = 4, IV3_OUT_OF_DATA = 5
}
 
enum  { H_SPLIT = 0, V_SPLIT = 1, INTRA_NULL = 2, INTER_DATA = 3 }
 

Variables

AVCodec ff_indeo3_decoder
 

Detailed Description

This is a decoder for Intel Indeo Video v3.

It is based on vector quantization, run-length coding and motion compensation. Known container formats: .avi and .mov Known FOURCCs: 'IV31', 'IV32'

See also
http://wiki.multimedia.cx/index.php?title=Indeo_3

Macro Definition Documentation

§ APPLY_DELTA_1011_INTER

#define APPLY_DELTA_1011_INTER
Value:
if (mode == 10) { \
AV_WN32A(dst , \
(AV_RN32(dst ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
AV_WN32A(dst + 4 , \
(AV_RN32(dst + 4 ) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
AV_WN32A(dst + row_offset , \
(AV_RN32(dst + row_offset ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
AV_WN32A(dst + row_offset + 4, \
(AV_RN32(dst + row_offset + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
} else { \
AV_WN16A(dst , \
(AV_RN16(dst ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
AV_WN16A(dst + 2 , \
(AV_RN16(dst + 2 ) + delta_tab->deltas[dyad2]) & 0x7F7F);\
AV_WN16A(dst + row_offset , \
(AV_RN16(dst + row_offset ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
AV_WN16A(dst + row_offset + 2, \
(AV_RN16(dst + row_offset + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
}
mode
Use these values in ebur128_init (or&#39;ed).
Definition: ebur128.h:83

§ APPLY_DELTA_4

#define APPLY_DELTA_4
Value:
AV_WN16A(dst + line_offset ,\
(AV_RN16(ref ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
AV_WN16A(dst + line_offset + 2,\
(AV_RN16(ref + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
if (mode >= 3) {\
if (is_top_of_cell && !cell->ypos) {\
AV_COPY32U(dst, dst + row_offset);\
} else {\
AVG_32(dst, ref, dst + row_offset);\
}\
}
In the ELBG jargon, a cell is the set of points that are closest to a codebook entry.
Definition: elbg.c:39
mode
Use these values in ebur128_init (or&#39;ed).
Definition: ebur128.h:83

§ APPLY_DELTA_8

#define APPLY_DELTA_8
Value:
/* apply two 32-bit VQ deltas to next even line */\
if (is_top_of_cell) { \
AV_WN32A(dst + row_offset , \
(replicate32(AV_RN32(ref )) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
AV_WN32A(dst + row_offset + 4, \
(replicate32(AV_RN32(ref + 4)) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
} else { \
AV_WN32A(dst + row_offset , \
(AV_RN32(ref ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
AV_WN32A(dst + row_offset + 4, \
(AV_RN32(ref + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
} \
/* odd lines are not coded but rather interpolated/replicated */\
/* first line of the cell on the top of image? - replicate */\
/* otherwise - interpolate */\
if (is_top_of_cell && !cell->ypos) {\
AV_COPY64U(dst, dst + row_offset);\
} else \
AVG_64(dst, ref, dst + row_offset);
In the ELBG jargon, a cell is the set of points that are closest to a codebook entry.
Definition: elbg.c:39

§ BUFFER_PRECHECK

#define BUFFER_PRECHECK
Value:
if (*data_ptr >= last_ptr) \
return IV3_OUT_OF_DATA; \

§ CHECK_CELL

#define CHECK_CELL
Value:
if (curr_cell.xpos + curr_cell.width > (plane->width >> 2) || \
curr_cell.ypos + curr_cell.height > (plane->height >> 2)) { \
av_log(avctx, AV_LOG_ERROR, "Invalid cell: x=%d, y=%d, w=%d, h=%d\n", \
curr_cell.xpos, curr_cell.ypos, curr_cell.width, curr_cell.height); \
}
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176

§ RESYNC_BITSTREAM

#define RESYNC_BITSTREAM
Value:
if (ctx->need_resync && !(get_bits_count(&ctx->gb) & 7)) { \
skip_bits_long(&ctx->gb, ctx->skip_bits); \
ctx->skip_bits = 0; \
ctx->need_resync = 0; \
}

§ RLE_BLOCK_COPY

#define RLE_BLOCK_COPY
Value:
if (cell->mv_ptr || !skip_flag) \
copy_block4(dst, ref, row_offset, row_offset, 4 << v_zoom)
In the ELBG jargon, a cell is the set of points that are closest to a codebook entry.
Definition: elbg.c:39

§ RLE_BLOCK_COPY_8

#define RLE_BLOCK_COPY_8
Value:
pix64 = AV_RN64(ref);\
if (is_first_row) {/* special prediction case: top line of a cell */\
pix64 = replicate64(pix64);\
fill_64(dst + row_offset, pix64, 7, row_offset);\
AVG_64(dst, ref, dst + row_offset);\
} else \
fill_64(dst, pix64, 8, row_offset)

§ RLE_LINES_COPY_M10

#define RLE_LINES_COPY_M10
Value:
pix64 = AV_RN64(ref);\
if (is_top_of_cell) {\
pix64 = replicate64(pix64);\
fill_64(dst + row_offset, pix64, (num_lines << 1) - 1, row_offset);\
AVG_64(dst, ref, dst + row_offset);\
} else \
fill_64(dst, pix64, num_lines << 1, row_offset)

§ UPDATE_BITPOS

#define UPDATE_BITPOS (   n)
Value:
ctx->skip_bits += (n); \
ctx->need_resync = 1

Enumeration Type Documentation

§ anonymous enum

anonymous enum
Enumerator
RLE_ESC_F9 

same as RLE_ESC_FA + do the same with next block

RLE_ESC_FA 

INTRA: skip block, INTER: copy data from reference.

RLE_ESC_FB 

apply null delta to N blocks / skip N blocks

RLE_ESC_FC 

same as RLE_ESC_FD + do the same with next block

RLE_ESC_FD 

apply null delta to all remaining lines of this block

RLE_ESC_FE 

apply null delta to all lines up to the 3rd line

RLE_ESC_FF 

apply null delta to all lines up to the 2nd line

Variable Documentation

§ ff_indeo3_decoder

AVCodec ff_indeo3_decoder
Initial value:
= {
.name = "indeo3",
.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_INDEO3,
.priv_data_size = sizeof(Indeo3DecodeContext),
.init = decode_init,
.close = decode_close,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
Definition: indeo3.c:83
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959