#include "avcodec.h"
#include "bytestream.h"
+#include "decode.h"
#include "internal.h"
typedef struct QpegContext{
AVFrame * const ref = a->ref;
uint8_t* outdata;
int delta, intra, ret;
- buffer_size_t pal_size;
- const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &pal_size);
if (avpkt->size < 0x86) {
av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
}
/* make the palette available on the way out */
- if (pal && pal_size == AVPALETTE_SIZE) {
- p->palette_has_changed = 1;
- memcpy(a->pal, pal, AVPALETTE_SIZE);
- } else if (pal) {
- av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
- }
+ p->palette_has_changed = ff_copy_palette(a->pal, avpkt, avctx);
memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
av_frame_unref(ref);
return 0;
}
-AVCodec ff_qpeg_decoder = {
+const AVCodec ff_qpeg_decoder = {
.name = "qpeg",
.long_name = NULL_IF_CONFIG_SMALL("Q-team QPEG"),
.type = AVMEDIA_TYPE_VIDEO,