* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
*/
/**
#include <string.h>
#include <unistd.h>
-#include "common.h"
#include "avcodec.h"
-#include "dsputil.h"
typedef struct QtrleContext {
AVCodecContext *avctx;
- DSPContext dsp;
AVFrame frame;
- unsigned char *buf;
+ const unsigned char *buf;
int size;
} QtrleContext;
int rle_code;
int row_ptr, pixel_ptr;
int row_inc = s->frame.linesize[0];
- unsigned char pi1, pi2, pi3, pi4, pi5, pi6, pi7, pi8; /* 8 palette indices */
+ unsigned char pi1, pi2, pi3, pi4, pi5, pi6, pi7, pi8; /* 8 palette indexes */
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
/* decode the run length code */
rle_code = -rle_code;
/* get the next 4 bytes from the stream, treat them as palette
- * indices, and output them rle_code times */
+ * indexes, and output them rle_code times */
CHECK_STREAM_PTR(4);
pi1 = ((s->buf[stream_ptr]) >> 4) & 0x0f;
pi2 = (s->buf[stream_ptr++]) & 0x0f;
int rle_code;
int row_ptr, pixel_ptr;
int row_inc = s->frame.linesize[0];
- unsigned char pi1, pi2, pi3, pi4; /* 4 palette indices */
+ unsigned char pi1, pi2, pi3, pi4; /* 4 palette indexes */
unsigned char *rgb = s->frame.data[0];
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
/* decode the run length code */
rle_code = -rle_code;
/* get the next 4 bytes from the stream, treat them as palette
- * indices, and output them rle_code times */
+ * indexes, and output them rle_code times */
CHECK_STREAM_PTR(4);
pi1 = s->buf[stream_ptr++];
pi2 = s->buf[stream_ptr++];
}
}
-static int qtrle_decode_init(AVCodecContext *avctx)
+static av_cold int qtrle_decode_init(AVCodecContext *avctx)
{
QtrleContext *s = avctx->priv_data;
avctx->bits_per_sample);
break;
}
- dsputil_init(&s->dsp, avctx);
s->frame.data[0] = NULL;
static int qtrle_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size)
{
QtrleContext *s = avctx->priv_data;
return buf_size;
}
-static int qtrle_decode_end(AVCodecContext *avctx)
+static av_cold int qtrle_decode_end(AVCodecContext *avctx)
{
QtrleContext *s = avctx->priv_data;
qtrle_decode_end,
qtrle_decode_frame,
CODEC_CAP_DR1,
+ .long_name = "QuickTime Animation (RLE) video",
};