Go to the documentation of this file.
47 #define C93_HAS_PALETTE 0x01
48 #define C93_FIRST_FRAME 0x02
67 if (!
s->pictures[0] || !
s->pictures[1])
108 int height,
int bpp, uint8_t cols[4], uint8_t grps[4], uint32_t col)
111 for (y = 0; y <
height; y++) {
113 cols[0] = grps[3 * (y >> 1)];
114 for (x = 0; x <
width; x++) {
116 cols[1]= grps[(x >> 1) + 1];
117 out[x + y*
stride] = cols[col & ((1 << bpp) - 1)];
126 const uint8_t *buf = avpkt->
data;
127 int buf_size = avpkt->
size;
133 int ret,
i, x, y,
b, bt = 0;
147 b = bytestream2_get_byte(&gb);
156 for (y = 0; y <
HEIGHT; y += 8) {
158 for (x = 0; x <
WIDTH; x += 8) {
160 uint8_t cols[4], grps[4];
164 bt = bytestream2_get_byte(&gb);
166 block_type= bt & 0x0F;
167 switch (block_type) {
169 int offset = bytestream2_get_le16(&gb);
178 for (
int j = 0; j < 8; j += 4) {
179 for (
i = 0;
i < 8;
i += 4) {
180 int offset = bytestream2_get_le16(&gb);
197 for (
i = 0;
i < 8;
i++) {
199 NULL, bytestream2_get_byte(&gb));
207 for (
int j = 0; j < 8; j += 4) {
208 for (
i = 0;
i < 8;
i += 4) {
212 1, cols,
NULL, bytestream2_get_le16(&gb));
216 2, cols,
NULL, bytestream2_get_le32(&gb));
220 1, cols, grps, bytestream2_get_le16(&gb));
230 for (
int j = 0; j < 8; j++)
245 uint32_t *palette = (uint32_t *) newpic->
data[1];
246 for (
i = 0;
i < 256;
i++) {
247 palette[
i] = 0xFF
U << 24 | bytestream2_get_be24(&gb);
249 #if FF_API_PALETTE_HAS_CHANGED
256 memcpy(newpic->
data[1], oldpic->
data[1], 256 * 4);
#define FF_ENABLE_DEPRECATION_WARNINGS
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
attribute_deprecated int palette_has_changed
Tell user application that palette has changed from previous frame.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
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.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVCodec p
The public AVCodec.
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.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
#define FF_CODEC_DECODE_CB(func)
static av_cold int decode_init(AVCodecContext *avctx)
#define CODEC_LONG_NAME(str)
static av_cold int decode_end(AVCodecContext *avctx)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
@ AV_PICTURE_TYPE_I
Intra.
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
enum AVPictureType pict_type
Picture type of the frame.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
static int copy_from(IpvideoContext *s, AVFrame *src, AVFrame *dst, int delta_x, int delta_y)
#define i(width, name, range_min, range_max)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
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)
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.
main external API structure.
const FFCodec ff_c93_decoder
#define FF_DISABLE_DEPRECATION_WARNINGS
@ AV_PICTURE_TYPE_P
Predicted.
Undefined Behavior In the C some operations are like signed integer overflow
#define avpriv_request_sample(...)
This structure stores compressed data.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int copy_block(AVCodecContext *avctx, uint8_t *to, uint8_t *from, int offset, int height, int stride)