]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ptx.c
Use add instead of lshift in mmxext vp8 idct
[ffmpeg] / libavcodec / ptx.c
index 79424b9c42cf0a20718ec98f0cefac9ce179655f..d8798f2e9c8d32c0b9dd4350aa4b34e54c8d505f 100644 (file)
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
 typedef struct PTXContext {
@@ -35,7 +36,8 @@ static av_cold int ptx_init(AVCodecContext *avctx) {
 }
 
 static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
-                            const uint8_t *buf, int buf_size) {
+                            AVPacket *avpkt) {
+    const uint8_t *buf = avpkt->data;
     PTXContext * const s = avctx->priv_data;
     AVFrame *picture = data;
     AVFrame * const p = &s->picture;
@@ -77,7 +79,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     stride = p->linesize[0];
 
     for (y=0; y<h; y++) {
-#ifdef WORDS_BIGENDIAN
+#if HAVE_BIGENDIAN
         unsigned int x;
         for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
             AV_WN16(ptr+x, AV_RL16(buf+x));
@@ -105,14 +107,14 @@ static av_cold int ptx_end(AVCodecContext *avctx) {
 
 AVCodec ptx_decoder = {
     "ptx",
-    CODEC_TYPE_VIDEO,
+    AVMEDIA_TYPE_VIDEO,
     CODEC_ID_PTX,
     sizeof(PTXContext),
     ptx_init,
     NULL,
     ptx_end,
     ptx_decode_frame,
-    0,
+    CODEC_CAP_DR1,
     NULL,
     .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"),
 };