Go to the documentation of this file.
67 for (y = 0; y <
height; y += 4) {
68 for (x = 0; x <
width; x += 4) {
72 mask = bytestream2_get_be16u(gb);
73 v[0] = bytestream2_get_be16u(gb);
74 v[1] = bytestream2_get_be16u(gb);
75 if ((v[0] & 0x8000)) {
80 for (
i = 2;
i < 8;
i++)
81 v[
i] = bytestream2_get_be16u(gb);
83 v[2] = v[4] = v[6] = v[0];
84 v[3] = v[5] = v[7] = v[1];
87 #define PIX16(target, true, false) \
88 i = (mask & target) ? true : false; \
89 AV_WN16A(dst, v[i] & 0x7FFF); \
92 #define ROW16(row, a1, a0, b1, b0) \
93 dst = dst_start + (y + row) * linesize + x * 2; \
94 PIX16(1 << (row * 4), a1, a0) \
95 PIX16(1 << (row * 4 + 1), a1, a0) \
96 PIX16(1 << (row * 4 + 2), b1, b0) \
97 PIX16(1 << (row * 4 + 3), b1, b0)
100 ROW16(1, 0, 1, 2, 3);
101 ROW16(2, 4, 5, 6, 7);
102 ROW16(3, 4, 5, 6, 7);
111 for (j = 0; j < 4; j++)
112 for (
i = 0;
i < 4;
i++)
116 #define PIX32(target, true, false) \
117 AV_WN32A(dst, (mask & target) ? v[true] : v[false]); \
120 #define ROW32(row, a1, a0, b1, b0) \
121 dst = dst_start + (y + row) * linesize + x * 4; \
122 PIX32(1 << (row * 4), a1, a0) \
123 PIX32(1 << (row * 4 + 1), a1, a0) \
124 PIX32(1 << (row * 4 + 2), b1, b0) \
125 PIX32(1 << (row * 4 + 3), b1, b0)
128 ROW32(0, 1, 0, 3, 2); \
129 ROW32(1, 1, 0, 3, 2); \
130 ROW32(2, 5, 4, 7, 6); \
131 ROW32(3, 5, 4, 7, 6);
135 int linesize,
int vflip)
138 uint32_t
color[128], v[8];
139 int w,
h, nb_colors,
i, x, y, p0, p1,
mask;
144 w = bytestream2_get_be16u(gb);
145 h = bytestream2_get_be16u(gb);
149 if (bytestream2_get_byteu(gb)) {
154 nb_colors = bytestream2_get_byteu(gb);
157 for (
i = 0;
i <
FFMIN(nb_colors, 128);
i++)
158 color[
i] = 0xFF000000 | bytestream2_get_be24u(gb);
163 dst_start += (
height - 1) * linesize;
164 linesize = -linesize;
168 p0 = bytestream2_get_byteu(gb);
172 p0 = (p0 << 2) | (p0 >> 4);
174 0xFF000000 | (p0 << 16) | (p0 << 8) | p0);
178 p0 = (p0 << 2) | (p0 >> 4);
181 g = bytestream2_get_byteu(gb);
182 r = bytestream2_get_byteu(gb);
184 0xFF000000 | (
r << 16) | (
g << 8) | p0);
189 p1 = bytestream2_get_byteu(gb);
191 if ((p0 & 0x7F) == (p1 & 0x7F)) {
197 v[0] = v[2] = v[4] = v[6] =
color[p0 & 0x7F];
198 v[1] = v[3] = v[5] = v[7] =
color[p1 & 0x7F];
199 mask = bytestream2_get_le16u(gb);
205 v[0] =
color[p0 & 0x7F];
206 v[1] =
color[p1 & 0x7F];
207 for (
i = 2;
i < 8;
i++)
208 v[
i] =
color[bytestream2_get_byteu(gb) & 0x7F];
209 mask = bytestream2_get_le16u(gb);
248 frame->key_frame = 1;
255 #if CONFIG_MVC1_DECODER
268 #if CONFIG_MVC2_DECODER
#define AV_LOG_WARNING
Something somehow does not look correct.
static av_cold int init(AVCodecContext *avctx)
static av_cold int mvc_decode_init(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static int decode_mvc2(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_start, int width, int height, int linesize, int vflip)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static const uint16_t mask[17]
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static int decode_mvc1(AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst_start, int width, int height, int linesize)
static void set_4x4_block(uint8_t *dst, int linesize, uint32_t pixel)
#define ROW16(row, a1, a0, b1, b0)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
@ AV_PICTURE_TYPE_I
Intra.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define AV_PIX_FMT_RGB555
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
#define avpriv_request_sample(...)
This structure stores compressed data.
int width
picture width / height.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int mvc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)