43 #define SCREEN_WIDE 640
44 #define SCREEN_HIGH 429
54 #define NEXT_BYTE(v) (v) = forward ? (v) + 1 : (v) - 1;
58 unsigned val, saved_val = 0;
60 const uint8_t *
src, *source_end = source + src_len;
64 int forward = (frame_off <= -
SCREEN_WIDE) || (frame_off >= 0);
65 int read_two_nibbles,
flag;
78 src = source + src_len - 1;
93 if (!
mode || (tmplen == 4)) {
94 if (src < source || src >= source_end)
100 read_two_nibbles = 0;
106 if (!read_two_nibbles) {
107 if (src < source || src >= source_end)
116 read_two_nibbles = 0;
137 advance_mode =
val & 1;
140 mode += 1 + advance_mode;
154 dst[
i] = dst[frame_off +
i];
163 for (
i =
len - 1;
i >= 0;
i--)
164 dst[
i] = dst[frame_off +
i];
169 if (source + src_len -
src <
len)
183 val = forward ? dst[-1] : dst[1];
208 type = bytestream_get_byte(&
c->stream);
210 int blobs = bytestream_get_byte(&
c->stream);
211 if (
pkt->
size < blobs * 65 + 2) {
215 c->stream += blobs * 65;
223 c->stream += command_size;
230 for (
i = 0;
i < 256;
i++)
231 c->pal[
i] = 0xFFU << 24 | bytestream_get_be24(&
c->stream);
238 scr_off = (int16_t)bytestream_get_le16(&
c->stream);
260 memcpy(outptr, srcptr, avctx->
width);
261 srcptr += avctx->
width;
283 c->frame =
c->frame_base + 640;
static double val(void *priv, double ch)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, int frame_off)
static av_cold int decode_init(AVCodecContext *avctx)
AVCodec ff_bmv_video_decoder
common internal and external API header
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
mode
Use these values in ebur128_init (or'ed).
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const uint16_t mask[17]
static void frame_end(MpegEncContext *s)
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static int shift(int a, int b)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int palette_has_changed
Tell user application that palette has changed from previous frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
This structure stores compressed data.
uint8_t frame_base[SCREEN_WIDE *(SCREEN_HIGH+1)]