Commit 04b53746 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  rtpdec: Use 4 byte startcodes for H.264
  matroskadec: Mark variable as av_unused.
  Move some conditionally used variables into the block where they are used.
  Drop some completely unnecessary av_unused attributes.
  swscale: Remove unused variable alpMmxFilter.
  Drop unnecessary av_uninit attributes from some variable declarations.
  movenc: Support muxing wmapro in ismv/isma
  mpegtsenc: Add an AVOption for forcing a new PAT/PMT/SDT to be written
  swscale: move YUV2PACKED16WRAPPER() macro down to where it is used.
  swscale: handle gray16 as a "planar" YUV format (Y-only, of course).
  swscale: use yuv2packed1() functions for unscaled chroma also.
  swscale: fix incorrect chroma bias in yuv2rgb48_1_c().
  swscale: fix invalid memory accesses in yuvpacked1() functions.
  Move PS2 MMI code below the mips subdirectory, where it belongs.
  mips: Move MMI function declarations to a header.
  build: Set correct dependencies for rtmp* protocols implemented by librtmp.

Conflicts:
	libavcodec/ac3enc_template.c
	libavformat/mpegtsenc.c
	libswscale/output.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 38778374 7dfe8f55
......@@ -1643,6 +1643,10 @@ https_protocol_select="tls_protocol"
mmsh_protocol_select="http_protocol"
mmst_protocol_deps="network"
rtmp_protocol_select="tcp_protocol"
rtmpe_protocol_deps="librtmp"
rtmps_protocol_deps="librtmp"
rtmpt_protocol_deps="librtmp"
rtmpte_protocol_deps="librtmp"
rtp_protocol_select="udp_protocol"
tcp_protocol_deps="network"
tls_protocol_deps_any="openssl gnutls"
......
......@@ -747,7 +747,7 @@ HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen \
dv_tablegen motionpixels_tablegen mpegaudio_tablegen \
pcm_tablegen qdm2_tablegen sinewin_tablegen
DIRS = alpha arm avr32 bfin ppc ps2 sh4 sparc x86
DIRS = alpha arm avr32 bfin mips ppc sh4 sparc x86
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
......
......@@ -1383,8 +1383,7 @@ static void ac3_output_frame_header(AC3EncodeContext *s)
*/
static void output_audio_block(AC3EncodeContext *s, int blk)
{
int ch, i, baie, bnd, got_cpl;
int av_uninit(ch0);
int ch, i, baie, bnd, got_cpl, ch0;
AC3Block *block = &s->blocks[blk];
/* block switching */
......@@ -2233,8 +2232,7 @@ static av_cold int validate_options(AC3EncodeContext *s)
*/
static av_cold void set_bandwidth(AC3EncodeContext *s)
{
int blk, ch;
int av_uninit(cpl_start);
int blk, ch, cpl_start;
if (s->cutoff) {
/* calculate bandwidth based on user-specified cutoff frequency */
......
......@@ -338,7 +338,7 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s)
{
int nb_coefs;
int blk, bnd;
AC3Block *block, *av_uninit(block0);
AC3Block *block, *block0;
if (s->channel_mode != AC3_CHMODE_STEREO)
return;
......
......@@ -1784,7 +1784,7 @@ typedef struct AVCodecContext {
#define FF_IDCT_SIMPLE 2
#define FF_IDCT_SIMPLEMMX 3
#define FF_IDCT_LIBMPEG2MMX 4
#define FF_IDCT_PS2 5
#define FF_IDCT_MMI 5
#define FF_IDCT_ARM 7
#define FF_IDCT_ALTIVEC 8
#define FF_IDCT_SH4 9
......
......@@ -66,7 +66,7 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){
*/
static int unpack(const uint8_t *src, const uint8_t *src_end, unsigned char *dst, int width, int height) {
unsigned char *dst_end = dst + width*height;
int size, size1, size2, av_uninit(offset), run;
int size, size1, size2, offset, run;
unsigned char *dst_start = dst;
if (src[0] & 0x01)
......
......@@ -288,7 +288,7 @@ static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order)
{
const int blocksize = s->blocksize;
int32_t *decoded = s->decoded[channel];
int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i;
int a, b, c, d, i;
/* warm up samples */
for (i = 0; i < pred_order; i++) {
......
OBJS-$(HAVE_MMI) += ps2/dsputil_mmi.o \
ps2/idct_mmi.o \
ps2/mpegvideo_mmi.o \
OBJS-$(HAVE_MMI) += mips/dsputil_mmi.o \
mips/idct_mmi.o \
mips/mpegvideo_mmi.o \
......@@ -25,10 +25,6 @@
#include "libavcodec/dsputil.h"
#include "mmi.h"
void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
void ff_mmi_idct(DCTELEM *block);
static void clear_blocks_mmi(DCTELEM * blocks)
{
__asm__ volatile(
......@@ -157,7 +153,7 @@ void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx)
}
if (avctx->bits_per_raw_sample <= 8 &&
(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_PS2)) {
(idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_MMI)) {
c->idct_put= ff_mmi_idct_put;
c->idct_add= ff_mmi_idct_add;
c->idct = ff_mmi_idct;
......
......@@ -18,8 +18,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_PS2_MMI_H
#define AVCODEC_PS2_MMI_H
#ifndef AVCODEC_MIPS_MMI_H
#define AVCODEC_MIPS_MMI_H
#include <stdint.h>
#include "libavcodec/dsputil.h"
void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block);
void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block);
void ff_mmi_idct(DCTELEM *block);
#define align16 __attribute__ ((aligned (16)))
......@@ -168,4 +176,4 @@
#define pextlb(rs, rt, rd) \
__asm__ volatile ("pextlb " #rd ", " #rs ", " #rt )
#endif /* AVCODEC_PS2_MMI_H */
#endif /* AVCODEC_MIPS_MMI_H */
......@@ -134,8 +134,8 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de
uint8_t *output, *output_end;
const uint8_t* src = data;
int p1, p2, line=avctx->height - 1, pos=0, i;
uint16_t av_uninit(pix16);
uint32_t av_uninit(pix32);
uint16_t pix16;
uint32_t pix32;
unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3);
output = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
......
......@@ -219,7 +219,7 @@ static const AVOption options[]={
{"simple", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"libmpeg2mmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_LIBMPEG2MMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"ps2", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_PS2 }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"mmi", NULL, 0, AV_OPT_TYPE_CONST, { .dbl = FF_IDCT_MMI }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"arm", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
{"sh4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},
......
......@@ -126,7 +126,7 @@ static void qtrle_encode_line(QtrleEncContext *s, AVFrame *p, int line, uint8_t
unsigned int skipcount;
/* This will be the number of consecutive equal pixels in the current
* frame, starting from the ith one also */
unsigned int av_uninit(repeatcount);
unsigned int repeatcount;
/* The cost of the three different possibilities */
int total_bulk_cost;
......
......@@ -120,7 +120,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
GradFunContext *gf = ctx->priv;
float thresh = 1.2;
int radius = 16;
av_unused int cpu_flags = av_get_cpu_flags();
int cpu_flags = av_get_cpu_flags();
if (args)
sscanf(args, "%f:%d", &thresh, &radius);
......
......@@ -370,7 +370,7 @@ static int query_formats(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
YADIFContext *yadif = ctx->priv;
av_unused int cpu_flags = av_get_cpu_flags();
int cpu_flags = av_get_cpu_flags();
yadif->mode = 0;
yadif->parity = -1;
......
......@@ -271,12 +271,10 @@ void av_register_all(void)
REGISTER_PROTOCOL (MD5, md5);
REGISTER_PROTOCOL (PIPE, pipe);
REGISTER_PROTOCOL (RTMP, rtmp);
#if CONFIG_LIBRTMP
REGISTER_PROTOCOL (RTMP, rtmpt);
REGISTER_PROTOCOL (RTMP, rtmpe);
REGISTER_PROTOCOL (RTMP, rtmpte);
REGISTER_PROTOCOL (RTMP, rtmps);
#endif
REGISTER_PROTOCOL (RTMPE, rtmpe);
REGISTER_PROTOCOL (RTMPS, rtmps);
REGISTER_PROTOCOL (RTMPT, rtmpt);
REGISTER_PROTOCOL (RTMPTE, rtmpte);
REGISTER_PROTOCOL (RTP, rtp);
REGISTER_PROTOCOL (TCP, tcp);
REGISTER_PROTOCOL (TLS, tls);
......
......@@ -361,8 +361,8 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
/* This code assumes that extradata contains only palette */
/* This is true for all paletted codecs implemented in libavcodec */
if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
int av_unused i;
#if HAVE_BIGENDIAN
int i;
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
asf_st->palette[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]);
#else
......
......@@ -967,7 +967,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
uint8_t* data = *buf;
int isize = *buf_size;
uint8_t* pkt_data = NULL;
uint8_t* newpktdata;
uint8_t av_unused *newpktdata;
int pkt_size = isize;
int result = 0;
int olen;
......
......@@ -362,6 +362,15 @@ static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track)
return update_size(pb, pos);
}
static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track)
{
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0);
ffio_wfourcc(pb, "wfex");
ff_put_wav_header(pb, track->enc);
return update_size(pb, pos);
}
static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track)
{
uint32_t layout_tag, bitmap;
......@@ -548,6 +557,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
mov_write_ac3_tag(pb, track);
else if(track->enc->codec_id == CODEC_ID_ALAC)
mov_write_extradata_tag(pb, track);
else if (track->enc->codec_id == CODEC_ID_WMAPRO)
mov_write_wfex_tag(pb, track);
else if (track->vos_len > 0)
mov_write_glbl_tag(pb, track);
......@@ -797,9 +808,13 @@ static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
{
int tag = track->enc->codec_tag;
if (track->mode == MODE_MP4 || track->mode == MODE_PSP || track->mode == MODE_ISM)
if (track->mode == MODE_MP4 || track->mode == MODE_PSP)
tag = mp4_get_codec_tag(s, track);
else if (track->mode == MODE_ISM) {
tag = mp4_get_codec_tag(s, track);
else if (track->mode == MODE_IPOD)
if (!tag && track->enc->codec_id == CODEC_ID_WMAPRO)
tag = MKTAG('w', 'm', 'a', ' ');
} else if (track->mode == MODE_IPOD)
tag = ipod_get_codec_tag(s, track);
else if (track->mode & MODE_3GP)
tag = ff_codec_get_tag(codec_3gp_tags, track->enc->codec_id);
......
......@@ -78,6 +78,8 @@ typedef struct MpegTSWrite {
int pmt_start_pid;
int start_pid;
int m2ts_mode;
int reemit_pat_pmt;
} MpegTSWrite;
/* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */
......@@ -101,6 +103,8 @@ static const AVOption options[] = {
{ "muxrate", NULL, offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT, {1}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
{ "pes_payload_size", "Minimum PES packet payload in bytes",
offsetof(MpegTSWrite, pes_payload_size), AV_OPT_TYPE_INT, {DEFAULT_PES_PAYLOAD_SIZE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
{ "resend_headers", "Reemit PAT/PMT before writing the next packet",
offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};
......@@ -978,6 +982,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
const uint64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE)*2;
int64_t dts = AV_NOPTS_VALUE, pts = AV_NOPTS_VALUE;
if (ts->reemit_pat_pmt) {
ts->pat_packet_count = ts->pat_packet_period - 1;
ts->sdt_packet_count = ts->sdt_packet_period - 1;
ts->reemit_pat_pmt = 0;
}
if (pkt->pts != AV_NOPTS_VALUE)
pts = pkt->pts + delay;
if (pkt->dts != AV_NOPTS_VALUE)
......
......@@ -272,7 +272,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s)
{
NSVContext *nsv = s->priv_data;
AVIOContext *pb = s->pb;
unsigned int av_unused file_size;
unsigned int file_size;
unsigned int size;
int64_t duration;
int strings_size;
......@@ -565,7 +565,6 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header)
uint32_t vsize;
uint16_t asize;
uint16_t auxsize;
uint32_t av_unused auxtag;
av_dlog(s, "%s(%d)\n", __FUNCTION__, fill_header);
......@@ -595,6 +594,7 @@ null_chunk_retry:
av_dlog(s, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize);
/* skip aux stuff */
for (i = 0; i < auxcount; i++) {
uint32_t auxtag;
auxsize = avio_rl16(pb);
auxtag = avio_rl32(pb);
av_dlog(s, "NSV aux data: '%c%c%c%c', %d bytes\n",
......
......@@ -113,7 +113,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream,
h264_data->level_idc = level_idc;
}
} else if (!strcmp(attr, "sprop-parameter-sets")) {
uint8_t start_sequence[]= { 0, 0, 1 };
uint8_t start_sequence[] = { 0, 0, 0, 1 };
codec->extradata_size= 0;
codec->extradata= NULL;
......@@ -176,7 +176,7 @@ static int h264_handle_packet(AVFormatContext *ctx,
uint8_t nal = buf[0];
uint8_t type = (nal & 0x1f);
int result= 0;
uint8_t start_sequence[]= {0, 0, 1};
uint8_t start_sequence[] = { 0, 0, 0, 1 };
#ifdef DEBUG
assert(data);
......
......@@ -181,7 +181,7 @@ static void sha256_transform(uint32_t *state, const uint8_t buffer[64])
{
unsigned int i, a, b, c, d, e, f, g, h;
uint32_t block[64];
uint32_t T1, av_unused(T2);
uint32_t T1;
a = state[0];
b = state[1];
......@@ -193,6 +193,7 @@ static void sha256_transform(uint32_t *state, const uint8_t buffer[64])
h = state[7];
#if CONFIG_SMALL
for (i = 0; i < 64; i++) {
uint32_t T2;
if (i < 16)
T1 = blk0(i);
else
......
This diff is collapsed.
......@@ -334,7 +334,6 @@ static int swScale(SwsContext *c, const uint8_t* src[],
int16_t *hChrFilter= c->hChrFilter;
int32_t *lumMmxFilter= c->lumMmxFilter;
int32_t *chrMmxFilter= c->chrMmxFilter;
int32_t av_unused *alpMmxFilter= c->alpMmxFilter;
const int vLumFilterSize= c->vLumFilterSize;
const int vChrFilterSize= c->vChrFilterSize;
const int hLumFilterSize= c->hLumFilterSize;
......@@ -539,7 +538,7 @@ static int swScale(SwsContext *c, const uint8_t* src[],
int16_t *vLumFilter= c->vLumFilter;
int16_t *vChrFilter= c->vChrFilter;
if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12 like
if (isPlanarYUV(dstFormat) || (isGray(dstFormat) && !isALPHA(dstFormat))) { //YV12 like
const int chrSkipMask= (1<<c->chrDstVSubSample)-1;
vLumFilter += dstY * vLumFilterSize;
......@@ -594,8 +593,8 @@ static int swScale(SwsContext *c, const uint8_t* src[],
} else {
assert(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2);
assert(chrUSrcPtr + vChrFilterSize - 1 < chrUPixBuf + vChrBufSize*2);
if (c->yuv2packed1 && vLumFilterSize == 1 && vChrFilterSize == 2) { //unscaled RGB
int chrAlpha = vChrFilter[2 * dstY + 1];
if (c->yuv2packed1 && vLumFilterSize == 1 && vChrFilterSize <= 2) { //unscaled RGB
int chrAlpha = vChrFilterSize == 1 ? 0 : vChrFilter[2 * dstY + 1];
yuv2packed1(c, *lumSrcPtr, chrUSrcPtr, chrVSrcPtr,
alpPixBuf ? *alpSrcPtr : NULL,
dest[0], dstW, chrAlpha, dstY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment