]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qpeg.c
Export H264 profile and level in AVCodecContext.
[ffmpeg] / libavcodec / qpeg.c
index 36c864c1899f9ff64dcc01d44d85bfa565244752..6b5d8732d955abbc4323dc9b2898bedf674231bd 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /**
- * @file qpeg.c
+ * @file libavcodec/qpeg.c
  * QPEG codec.
  */
 
@@ -108,9 +108,9 @@ static void qpeg_decode_intra(const uint8_t *src, uint8_t *dst, int size,
     }
 }
 
-static int qpeg_table_h[16] =
+static const int qpeg_table_h[16] =
  { 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
-static int qpeg_table_w[16] =
+static const int qpeg_table_w[16] =
  { 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
 
 /* Decodes delta frames */
@@ -248,8 +248,10 @@ static void qpeg_decode_inter(const uint8_t *src, uint8_t *dst, int size,
 
 static int 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;
     QpegContext * const a = avctx->priv_data;
     AVFrame * const p= (AVFrame*)&a->pic;
     uint8_t* outdata;
@@ -287,9 +289,12 @@ static int decode_frame(AVCodecContext *avctx,
 static av_cold int decode_init(AVCodecContext *avctx){
     QpegContext * const a = avctx->priv_data;
 
+    if (!avctx->palctrl) {
+        av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");
+        return -1;
+    }
     a->avctx = avctx;
     avctx->pix_fmt= PIX_FMT_PAL8;
-    a->pic.data[0] = NULL;
     a->refdata = av_malloc(avctx->width * avctx->height);
 
     return 0;