summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-24 02:08:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-24 03:32:24 +0100
commit8e576d58306df95d6373dd0ca2c1f21f1afaeca9 (patch)
tree5f7b9c8783b342e80e32b58b94ded819eb414b3c /libavcodec
parent7ffa9ea05aa951b6b13e615f1bd3b8280f758561 (diff)
parentbbb46f3ec7128d8a624f2aa5b4f99ec44c0b9567 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: libavutil: add utility functions to simplify allocation of audio buffers. libavutil: add planar sample formats and av_sample_fmt_is_planar() avconv: fix segfault at EOF with delayed pictures pcmdec: remove unneeded resetting of samples pointer avconv: remove a now unused parameter from output_packet(). avconv: formatting fixes in output_packet() avconv: declare some variables in blocks where they are used avconv: use the same behavior when decoding audio/video/subs bethsoftvideo: return proper consumed size for palette packets. cdg: skip packets that don't contain a cdg command. crcenc: add flags avconv: use vsync 0 for AVFMT_NOTIMESTAMPS formats. tiffenc: add a private option for selecting compression algorithm md5enc: add flags ARM: remove needless .text/.align directives Conflicts: doc/APIchanges libavcodec/tiffenc.c libavutil/avutil.h libavutil/samplefmt.c libavutil/samplefmt.h tests/ref/fate/bethsoft-vid tests/ref/fate/cdgraphics tests/ref/fate/film-cvid-pcm-stereo-8bit tests/ref/fate/mpeg2-field-enc tests/ref/fate/nuv tests/ref/fate/tiertex-seq tests/ref/fate/tscc-32bit tests/ref/fate/vmnc-32bit Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/arm/dsputil_armv6.S2
-rw-r--r--libavcodec/arm/dsputil_neon.S1
-rw-r--r--libavcodec/arm/fft_neon.S1
-rw-r--r--libavcodec/arm/fmtconvert_neon.S1
-rw-r--r--libavcodec/arm/h264dsp_neon.S3
-rw-r--r--libavcodec/arm/h264idct_neon.S1
-rw-r--r--libavcodec/arm/int_neon.S1
-rw-r--r--libavcodec/arm/mdct_neon.S2
-rw-r--r--libavcodec/arm/simple_idct_arm.S2
-rw-r--r--libavcodec/bethsoftvideo.c10
-rw-r--r--libavcodec/pcm.c3
-rw-r--r--libavcodec/tiffenc.c31
12 files changed, 31 insertions, 27 deletions
diff --git a/libavcodec/arm/dsputil_armv6.S b/libavcodec/arm/dsputil_armv6.S
index a2c8588fad..1adedf7b8f 100644
--- a/libavcodec/arm/dsputil_armv6.S
+++ b/libavcodec/arm/dsputil_armv6.S
@@ -22,8 +22,6 @@
preserve8
- .text
-
.macro call_2x_pixels type, subp
function ff_\type\()_pixels16\subp\()_armv6, export=1
push {r0-r3, lr}
diff --git a/libavcodec/arm/dsputil_neon.S b/libavcodec/arm/dsputil_neon.S
index 1574ad6496..b765f23d02 100644
--- a/libavcodec/arm/dsputil_neon.S
+++ b/libavcodec/arm/dsputil_neon.S
@@ -23,7 +23,6 @@
#include "asm.S"
preserve8
- .text
function ff_clear_block_neon, export=1
vmov.i16 q0, #0
diff --git a/libavcodec/arm/fft_neon.S b/libavcodec/arm/fft_neon.S
index fd76edcd15..ef8e4d4210 100644
--- a/libavcodec/arm/fft_neon.S
+++ b/libavcodec/arm/fft_neon.S
@@ -28,7 +28,6 @@
#define M_SQRT1_2 0.70710678118654752440
- .text
function fft4_neon
vld1.32 {d0-d3}, [r0,:128]
diff --git a/libavcodec/arm/fmtconvert_neon.S b/libavcodec/arm/fmtconvert_neon.S
index d1ad32ed27..17af9f524a 100644
--- a/libavcodec/arm/fmtconvert_neon.S
+++ b/libavcodec/arm/fmtconvert_neon.S
@@ -23,7 +23,6 @@
#include "asm.S"
preserve8
- .text
function ff_float_to_int16_neon, export=1
subs r2, r2, #8
diff --git a/libavcodec/arm/h264dsp_neon.S b/libavcodec/arm/h264dsp_neon.S
index 6426f46637..adc21f9500 100644
--- a/libavcodec/arm/h264dsp_neon.S
+++ b/libavcodec/arm/h264dsp_neon.S
@@ -392,9 +392,6 @@ function ff_\type\()_h264_chroma_mc2_neon, export=1
endfunc
.endm
- .text
- .align
-
h264_chroma_mc8 put
h264_chroma_mc8 avg
h264_chroma_mc4 put
diff --git a/libavcodec/arm/h264idct_neon.S b/libavcodec/arm/h264idct_neon.S
index 8cf9bd8b66..49b301247f 100644
--- a/libavcodec/arm/h264idct_neon.S
+++ b/libavcodec/arm/h264idct_neon.S
@@ -21,7 +21,6 @@
#include "asm.S"
preserve8
- .text
function ff_h264_idct_add_neon, export=1
vld1.64 {d0-d3}, [r1,:128]
diff --git a/libavcodec/arm/int_neon.S b/libavcodec/arm/int_neon.S
index e8023e0686..e1353982d0 100644
--- a/libavcodec/arm/int_neon.S
+++ b/libavcodec/arm/int_neon.S
@@ -23,7 +23,6 @@
preserve8
.fpu neon
- .text
function ff_scalarproduct_int16_neon, export=1
vmov.i16 q0, #0
diff --git a/libavcodec/arm/mdct_neon.S b/libavcodec/arm/mdct_neon.S
index 2def704497..9b7dc6ce83 100644
--- a/libavcodec/arm/mdct_neon.S
+++ b/libavcodec/arm/mdct_neon.S
@@ -23,8 +23,6 @@
preserve8
- .text
-
#define ff_fft_calc_neon X(ff_fft_calc_neon)
function ff_imdct_half_neon, export=1
diff --git a/libavcodec/arm/simple_idct_arm.S b/libavcodec/arm/simple_idct_arm.S
index f85c89a1b7..4d6d3fb5ad 100644
--- a/libavcodec/arm/simple_idct_arm.S
+++ b/libavcodec/arm/simple_idct_arm.S
@@ -53,8 +53,6 @@
#define COL_SHIFTED_1 524288 /* 1<< (COL_SHIFT-1) */
- .text
-
function ff_simple_idct_arm, export=1
@@ void simple_idct_arm(int16_t *block)
@@ save stack for reg needed (take all of them),
diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c
index 1a19c19d99..059947fead 100644
--- a/libavcodec/bethsoftvideo.c
+++ b/libavcodec/bethsoftvideo.c
@@ -47,15 +47,20 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
return 0;
}
-static void set_palette(AVFrame * frame, const uint8_t * palette_buffer)
+static int set_palette(AVFrame * frame, const uint8_t * palette_buffer, int buf_size)
{
uint32_t * palette = (uint32_t *)frame->data[1];
int a;
+
+ if (buf_size < 256*3)
+ return AVERROR_INVALIDDATA;
+
for(a = 0; a < 256; a++){
palette[a] = 0xFF << 24 | AV_RB24(&palette_buffer[a * 3]) * 4;
palette[a] |= palette[a] >> 6 & 0x30303;
}
frame->palette_has_changed = 1;
+ return 256*3;
}
static int bethsoftvid_decode_frame(AVCodecContext *avctx,
@@ -82,8 +87,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
switch(block_type = *buf++){
case PALETTE_BLOCK:
- set_palette(&vid->frame, buf);
- return 0;
+ return set_palette(&vid->frame, buf, buf_size);
case VIDEO_YOFF_P_FRAME:
yoffset = bytestream_get_le16(&buf);
if(yoffset >= avctx->height)
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 0bc0882081..92519c0534 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -384,7 +384,6 @@ static int pcm_decode_frame(AVCodecContext *avctx,
#endif /* HAVE_BIGENDIAN */
case CODEC_ID_PCM_U8:
memcpy(samples, src, n*sample_size);
- samples += n * sample_size;
break;
case CODEC_ID_PCM_ZORK:
for (; n > 0; n--) {
@@ -430,7 +429,6 @@ static int pcm_decode_frame(AVCodecContext *avctx,
}
break;
}
- samples = (uint8_t *) dst_int32_t;
break;
}
case CODEC_ID_PCM_LXF:
@@ -453,7 +451,6 @@ static int pcm_decode_frame(AVCodecContext *avctx,
((src8[2] & 0xF0) << 8) | (src8[4] << 4) | (src8[3] >> 4);
}
}
- samples = (uint8_t *) dst_int32_t;
break;
}
default:
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index b9a1e20fa5..9656cd9b68 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -25,6 +25,9 @@
* @author Bartlomiej Wolowiec
*/
+#include "libavutil/log.h"
+#include "libavutil/opt.h"
+
#include "avcodec.h"
#if CONFIG_ZLIB
#include <zlib.h>
@@ -44,7 +47,7 @@ static const uint8_t type_sizes2[6] = {
};
typedef struct TiffEncoderContext {
- AVClass *avclass;
+ AVClass *class; ///< for private options
AVCodecContext *avctx;
AVFrame picture;
@@ -230,7 +233,6 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
p->key_frame = 1;
avctx->coded_frame= &s->picture;
- s->compr = TIFF_PACKBITS;
if (avctx->compression_level == 0) {
s->compr = TIFF_RAW;
} else if(avctx->compression_level == 2) {
@@ -453,11 +455,26 @@ fail:
return ret;
}
-static const AVOption options[]={
-{"dpi", "set the image resolution (in dpi)", offsetof(TiffEncoderContext, dpi), AV_OPT_TYPE_INT, {.dbl = 72}, 1, 0x10000, AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_ENCODING_PARAM},
-{NULL}
+#define OFFSET(x) offsetof(TiffEncoderContext, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ {"dpi", "set the image resolution (in dpi)", OFFSET(dpi), AV_OPT_TYPE_INT, {.dbl = 72}, 1, 0x10000, AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_ENCODING_PARAM},
+ { "compression_algo", NULL, OFFSET(compr), AV_OPT_TYPE_INT, {TIFF_PACKBITS}, TIFF_RAW, TIFF_DEFLATE, VE, "compression_algo" },
+ { "packbits", NULL, 0, AV_OPT_TYPE_CONST, {TIFF_PACKBITS}, 0, 0, VE, "compression_algo" },
+ { "raw", NULL, 0, AV_OPT_TYPE_CONST, {TIFF_RAW}, 0, 0, VE, "compression_algo" },
+ { "lzw", NULL, 0, AV_OPT_TYPE_CONST, {TIFF_LZW}, 0, 0, VE, "compression_algo" },
+#if CONFIG_ZLIB
+ { "deflate", NULL, 0, AV_OPT_TYPE_CONST, {TIFF_DEFLATE}, 0, 0, VE, "compression_algo" },
+#endif
+ { NULL },
+};
+
+static const AVClass tiffenc_class = {
+ .class_name = "TIFF encoder",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
};
-static const AVClass class = { "tiff", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
AVCodec ff_tiff_encoder = {
.name = "tiff",
@@ -473,5 +490,5 @@ AVCodec ff_tiff_encoder = {
PIX_FMT_YUV411P, PIX_FMT_RGB48LE,
PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
- .priv_class= &class,
+ .priv_class = &tiffenc_class,
};