]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qtrle.c
Use ff_sqrt() function instead of using a table
[ffmpeg] / libavcodec / qtrle.c
index b63112221d89914a5d53f1c1985ae6f5e0b1c79d..939ceac9a9f8ad3bce2abe6962d8b142bf150834 100644 (file)
@@ -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
- *
  */
 
 /**
 #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;
@@ -489,9 +485,9 @@ 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 = (QtrleContext *)avctx->priv_data;
+    QtrleContext *s = avctx->priv_data;
 
     s->avctx = avctx;
     switch (avctx->bits_per_sample) {
@@ -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,9 +527,9 @@ 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 = (QtrleContext *)avctx->priv_data;
+    QtrleContext *s = avctx->priv_data;
 
     s->buf = buf;
     s->size = buf_size;
@@ -605,9 +600,9 @@ 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 = (QtrleContext *)avctx->priv_data;
+    QtrleContext *s = avctx->priv_data;
 
     if (s->frame.data[0])
         avctx->release_buffer(avctx, &s->frame);
@@ -625,5 +620,6 @@ AVCodec qtrle_decoder = {
     qtrle_decode_end,
     qtrle_decode_frame,
     CODEC_CAP_DR1,
+    .long_name = "QuickTime Animation (RLE) video",
 };