X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fqtrle.c;h=4b0f38f740ffb4a65ad8ac6ad609ed2f3dedfbf0;hb=892d226857f9276d94f7734b0cd9af9ac3385086;hp=5c6ccb4fb1e2e00e86019879f78957e695a6b0be;hpb=e4141433ead866d1b359c0cbf3e4d5180477206d;p=ffmpeg diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index 5c6ccb4fb1e..4b0f38f740f 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -17,7 +17,6 @@ * 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 - * */ /** @@ -37,17 +36,14 @@ #include #include -#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; @@ -83,7 +79,7 @@ static void qtrle_decode_4bpp(QtrleContext *s) 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; @@ -126,7 +122,7 @@ static void qtrle_decode_4bpp(QtrleContext *s) /* 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; @@ -174,7 +170,7 @@ static void qtrle_decode_8bpp(QtrleContext *s) 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; @@ -217,7 +213,7 @@ static void qtrle_decode_8bpp(QtrleContext *s) /* 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++]; @@ -489,7 +485,7 @@ static void qtrle_decode_32bpp(QtrleContext *s) } } -static int qtrle_decode_init(AVCodecContext *avctx) +static av_cold int qtrle_decode_init(AVCodecContext *avctx) { QtrleContext *s = avctx->priv_data; @@ -523,7 +519,6 @@ static int qtrle_decode_init(AVCodecContext *avctx) avctx->bits_per_sample); break; } - dsputil_init(&s->dsp, avctx); s->frame.data[0] = NULL; @@ -532,7 +527,7 @@ static int qtrle_decode_init(AVCodecContext *avctx) 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; @@ -605,7 +600,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx, return buf_size; } -static int qtrle_decode_end(AVCodecContext *avctx) +static av_cold int qtrle_decode_end(AVCodecContext *avctx) { QtrleContext *s = avctx->priv_data; @@ -625,5 +620,6 @@ AVCodec qtrle_decoder = { qtrle_decode_end, qtrle_decode_frame, CODEC_CAP_DR1, + .long_name = "QuickTime Animation (RLE) video", };