35 static const uint8_t coded[] = { 0, 0, 0, 13, 0, 0, 1, 1, 1, 2, 3, 4, 255 };
36 static const uint8_t no_change[] = { 0, 0, 0, 7, 0, 0, 0 };
37 static const uint8_t pixels[] = { 1, 2, 3, 4 };
45 if (!
ctx || !packet || !held || !duplicate)
49 ctx->bits_per_coded_sample = 8;
53 memcpy(packet->
data, coded,
sizeof(coded));
64 memcpy(packet->
data, no_change,
sizeof(no_change));
67 memcmp(duplicate->
data[0], pixels,
sizeof(pixels)) ||
75 fprintf(stderr,
"QTRLE duplicate palette test failed\n");
static AVFormatContext * ctx
static int decode(AVCodecContext *ctx, const AVPacket *packet, AVFrame *frame)
static const uint8_t palette[16][3]
Libavcodec external API header.
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Alias for avcodec_receive_frame_flags(avctx, frame, 0).
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
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.
main external API structure.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
This structure stores compressed data.