48#define C93_HAS_PALETTE 0x01
49#define C93_FIRST_FRAME 0x02
68 if (!
s->pictures[0] || !
s->pictures[1])
109 int height,
int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
112 for (y = 0; y <
height; y++) {
114 cols[0] = grps[3 * (y >> 1)];
115 for (x = 0; x <
width; x++) {
117 cols[1]= grps[(x >> 1) + 1];
118 out[x + y*
stride] = cols[col & ((1 << bpp) - 1)];
127 const uint8_t *buf = avpkt->
data;
128 int buf_size = avpkt->
size;
134 int ret,
i, x, y,
b, bt = 0;
148 b = bytestream2_get_byte(&gb);
157 for (y = 0; y <
HEIGHT; y += 8) {
159 for (x = 0; x <
WIDTH; x += 8) {
161 uint8_t cols[4], grps[4];
165 bt = bytestream2_get_byte(&gb);
167 block_type= bt & 0x0F;
168 switch (block_type) {
170 int offset = bytestream2_get_le16(&gb);
180 for (
int j = 0; j < 8; j += 4) {
181 for (
i = 0;
i < 8;
i += 4) {
182 int offset = bytestream2_get_le16(&gb);
199 for (
i = 0;
i < 8;
i++) {
201 NULL, bytestream2_get_byte(&gb));
209 for (
int j = 0; j < 8; j += 4) {
210 for (
i = 0;
i < 8;
i += 4) {
214 1, cols,
NULL, bytestream2_get_le16(&gb));
218 2, cols,
NULL, bytestream2_get_le32(&gb));
222 1, cols, grps, bytestream2_get_le16(&gb));
232 for (
int j = 0; j < 8; j++)
247 uint32_t *palette = (uint32_t *) newpic->
data[1];
248 for (
i = 0;
i < 256;
i++) {
249 palette[
i] = 0xFFU << 24 | bytestream2_get_be24(&gb);
253 memcpy(newpic->
data[1], oldpic->
data[1], 256 * 4);
const FFCodec ff_c93_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
int(* init)(AVBSFContext *ctx)
#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_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
static int copy_from(IpvideoContext *s, AVFrame *src, AVFrame *dst, int delta_x, int delta_y)
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
static int copy_block(AVCodecContext *avctx, uint8_t *to, uint8_t *from, int offset, int height, int stride)
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
static void draw_n_color(uint8_t *out, int stride, int width, int height, int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
Macro definitions for various function/variable attributes.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
#define avpriv_request_sample(...)