*/
/**
- * @file vqavideo.c
+ * @file libavcodec/vqavideo.c
* VQA Video Decoder by Mike Melanson (melanson@pcisys.net)
* For more information about the VQA format, visit:
* http://wiki.multimedia.cx/index.php?title=VQA
* file. This is an interesting technique, although it makes random file
* seeking difficult despite the fact that the frames are all intracoded.
*
- * V1,2 VQA uses 12-bit codebook indices. If the 12-bit indices were
+ * V1,2 VQA uses 12-bit codebook indexes. If the 12-bit indexes were
* packed into bytes and then RLE compressed, bytewise, the results would
* be poor. That is why the coding method divides each index into 2 parts,
* the top 4 bits and the bottom 8 bits, then RL encodes the 4-bit pieces
#include <string.h>
#include <unistd.h>
+#include "libavutil/intreadwrite.h"
#include "avcodec.h"
-#include "dsputil.h"
#define PALETTE_COUNT 256
#define VQA_HEADER_SIZE 0x2A
typedef struct VqaContext {
AVCodecContext *avctx;
- DSPContext dsp;
AVFrame frame;
const unsigned char *buf;
} VqaContext;
-static int vqa_decode_init(AVCodecContext *avctx)
+static av_cold int vqa_decode_init(AVCodecContext *avctx)
{
VqaContext *s = avctx->priv_data;
unsigned char *vqa_header;
- int i, j, codebook_index;;
+ int i, j, codebook_index;
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
- dsputil_init(&s->dsp, avctx);
/* make sure the extradata made it */
if (s->avctx->extradata_size != VQA_HEADER_SIZE) {
static int vqa_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VqaContext *s = avctx->priv_data;
s->buf = buf;
return buf_size;
}
-static int vqa_decode_end(AVCodecContext *avctx)
+static av_cold int vqa_decode_end(AVCodecContext *avctx)
{
VqaContext *s = avctx->priv_data;
vqa_decode_end,
vqa_decode_frame,
CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"),
};