]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/targa.c
uses FF_ARRAY_ELEMS() where appropriate
[ffmpeg] / libavcodec / targa.c
index e595dfa62b9e7839aaa0eda10de57088a81277b7..f9bc343997bd3c6868becf8a303dac00f47cd6cc 100644 (file)
@@ -37,7 +37,7 @@ typedef struct TargaContext {
     int compression_type;
 } TargaContext;
 
-static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, uint8_t *src, uint8_t *dst, int w, int h, int stride, int bpp)
+static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, const uint8_t *src, uint8_t *dst, int w, int h, int stride, int bpp)
 {
     int i, x, y;
     int depth = (bpp + 1) >> 3;
@@ -89,7 +89,7 @@ static void targa_decode_rle(AVCodecContext *avctx, TargaContext *s, uint8_t *sr
 
 static int decode_frame(AVCodecContext *avctx,
                         void *data, int *data_size,
-                        uint8_t *buf, int buf_size)
+                        const uint8_t *buf, int buf_size)
 {
     TargaContext * const s = avctx->priv_data;
     AVFrame *picture = data;
@@ -220,7 +220,7 @@ static int decode_frame(AVCodecContext *avctx,
     return buf_size;
 }
 
-static int targa_init(AVCodecContext *avctx){
+static av_cold int targa_init(AVCodecContext *avctx){
     TargaContext *s = avctx->priv_data;
 
     avcodec_get_frame_defaults((AVFrame*)&s->picture);
@@ -230,7 +230,7 @@ static int targa_init(AVCodecContext *avctx){
     return 0;
 }
 
-static int targa_end(AVCodecContext *avctx){
+static av_cold int targa_end(AVCodecContext *avctx){
     TargaContext *s = avctx->priv_data;
 
     if(s->picture.data[0])
@@ -249,5 +249,6 @@ AVCodec targa_decoder = {
     targa_end,
     decode_frame,
     0,
-    NULL
+    NULL,
+    .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
 };