Commit d303e0af authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  simple_idct: simplify some ifdeffery
  simple_idct: remove code for DCTELEM != int16
  Remove VLAs in ff_amrwb_lsp2lpc()
  fate: make vsynth tests depend on only the relevant vref
  rtsp: remove disabled code
  dsputil: restore mistakenly removed hunk of disabled code
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 257f274d 3e9409b1
...@@ -174,6 +174,16 @@ static int pix_norm1_c(uint8_t * pix, int line_size) ...@@ -174,6 +174,16 @@ static int pix_norm1_c(uint8_t * pix, int line_size)
s = 0; s = 0;
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j += 8) { for (j = 0; j < 16; j += 8) {
#if 0
s += sq[pix[0]];
s += sq[pix[1]];
s += sq[pix[2]];
s += sq[pix[3]];
s += sq[pix[4]];
s += sq[pix[5]];
s += sq[pix[6]];
s += sq[pix[7]];
#else
#if LONG_MAX > 2147483647 #if LONG_MAX > 2147483647
register uint64_t x=*(uint64_t*)pix; register uint64_t x=*(uint64_t*)pix;
s += sq[x&0xff]; s += sq[x&0xff];
...@@ -195,6 +205,7 @@ static int pix_norm1_c(uint8_t * pix, int line_size) ...@@ -195,6 +205,7 @@ static int pix_norm1_c(uint8_t * pix, int line_size)
s += sq[(x>>8)&0xff]; s += sq[(x>>8)&0xff];
s += sq[(x>>16)&0xff]; s += sq[(x>>16)&0xff];
s += sq[(x>>24)&0xff]; s += sq[(x>>24)&0xff];
#endif
#endif #endif
pix += 8; pix += 8;
} }
......
...@@ -120,8 +120,8 @@ void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order) ...@@ -120,8 +120,8 @@ void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order) void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order)
{ {
int lp_half_order = lp_order >> 1; int lp_half_order = lp_order >> 1;
double buf[lp_half_order + 1]; double buf[MAX_LP_HALF_ORDER + 1];
double pa[lp_half_order + 1]; double pa[MAX_LP_HALF_ORDER + 1];
double *qa = buf + 1; double *qa = buf + 1;
int i,j; int i,j;
......
...@@ -91,7 +91,7 @@ void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order); ...@@ -91,7 +91,7 @@ void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order);
void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order); void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order);
#define MAX_LP_HALF_ORDER 8 #define MAX_LP_HALF_ORDER 10
#define MAX_LP_ORDER (2*MAX_LP_HALF_ORDER) #define MAX_LP_ORDER (2*MAX_LP_HALF_ORDER)
/** /**
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
based upon some outcommented c code from mpeg2dec (idct_mmx.c based upon some outcommented c code from mpeg2dec (idct_mmx.c
written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>) written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
*/ */
#include "libavutil/intreadwrite.h"
#include "avcodec.h" #include "avcodec.h"
#include "dsputil.h" #include "dsputil.h"
#include "mathops.h" #include "mathops.h"
...@@ -47,51 +49,27 @@ ...@@ -47,51 +49,27 @@
static inline void idctRowCondDC (DCTELEM * row) static inline void idctRowCondDC (DCTELEM * row)
{ {
int a0, a1, a2, a3, b0, b1, b2, b3; int a0, a1, a2, a3, b0, b1, b2, b3;
#if HAVE_FAST_64BIT
uint64_t temp;
#else
uint32_t temp;
#endif
#if HAVE_FAST_64BIT #if HAVE_FAST_64BIT
#if HAVE_BIGENDIAN #define ROW0_MASK (0xffffLL << 48 * HAVE_BIGENDIAN)
#define ROW0_MASK 0xffff000000000000LL if (((((uint64_t *)row)[0] & ~ROW0_MASK) | ((uint64_t *)row)[1]) == 0) {
#else uint64_t temp = (row[0] << 3) & 0xffff;
#define ROW0_MASK 0xffffLL temp += temp << 16;
#endif temp += temp << 32;
if(sizeof(DCTELEM)==2){ ((uint64_t *)row)[0] = temp;
if ( ((((uint64_t *)row)[0] & ~ROW0_MASK) | ((uint64_t *)row)[1] = temp;
((uint64_t *)row)[1]) == 0) { return;
temp = (row[0] << 3) & 0xffff;
temp += temp << 16;
temp += temp << 32;
((uint64_t *)row)[0] = temp;
((uint64_t *)row)[1] = temp;
return;
}
}else{
if (!(row[1]|row[2]|row[3]|row[4]|row[5]|row[6]|row[7])) {
row[0]=row[1]=row[2]=row[3]=row[4]=row[5]=row[6]=row[7]= row[0] << 3;
return;
}
} }
#else #else
if(sizeof(DCTELEM)==2){ if (!(((uint32_t*)row)[1] |
if (!(((uint32_t*)row)[1] | ((uint32_t*)row)[2] |
((uint32_t*)row)[2] | ((uint32_t*)row)[3] |
((uint32_t*)row)[3] | row[1])) {
row[1])) { uint32_t temp = (row[0] << 3) & 0xffff;
temp = (row[0] << 3) & 0xffff; temp += temp << 16;
temp += temp << 16; ((uint32_t*)row)[0]=((uint32_t*)row)[1] =
((uint32_t*)row)[0]=((uint32_t*)row)[1] =
((uint32_t*)row)[2]=((uint32_t*)row)[3] = temp; ((uint32_t*)row)[2]=((uint32_t*)row)[3] = temp;
return; return;
}
}else{
if (!(row[1]|row[2]|row[3]|row[4]|row[5]|row[6]|row[7])) {
row[0]=row[1]=row[2]=row[3]=row[4]=row[5]=row[6]=row[7]= row[0] << 3;
return;
}
} }
#endif #endif
...@@ -115,12 +93,7 @@ static inline void idctRowCondDC (DCTELEM * row) ...@@ -115,12 +93,7 @@ static inline void idctRowCondDC (DCTELEM * row)
b3 = MUL16(W7, row[1]); b3 = MUL16(W7, row[1]);
MAC16(b3, -W5, row[3]); MAC16(b3, -W5, row[3]);
#if HAVE_FAST_64BIT if (AV_RN64A(row + 4)) {
temp = ((uint64_t*)row)[1];
#else
temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
#endif
if (temp != 0) {
a0 += W4*row[4] + W6*row[6]; a0 += W4*row[4] + W6*row[6];
a1 += - W4*row[4] - W2*row[6]; a1 += - W4*row[4] - W2*row[6];
a2 += - W4*row[4] + W2*row[6]; a2 += - W4*row[4] + W2*row[6];
......
...@@ -1116,17 +1116,9 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, ...@@ -1116,17 +1116,9 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
} }
} }
#if 0
/* then try on any port */
if (ffurl_open(&rtsp_st->rtp_handle, "rtp://", AVIO_FLAG_READ) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
#else
av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n"); av_log(s, AV_LOG_ERROR, "Unable to open an input RTP port\n");
err = AVERROR(EIO); err = AVERROR(EIO);
goto fail; goto fail;
#endif
rtp_opened: rtp_opened:
port = rtp_get_local_rtp_port(rtsp_st->rtp_handle); port = rtp_get_local_rtp_port(rtsp_st->rtp_handle);
......
...@@ -220,9 +220,6 @@ typedef struct RTSPState { ...@@ -220,9 +220,6 @@ typedef struct RTSPState {
* see rtsp_read_play() and rtsp_read_seek(). */ * see rtsp_read_play() and rtsp_read_seek(). */
int64_t seek_timestamp; int64_t seek_timestamp;
/* XXX: currently we use unbuffered input */
// AVIOContext rtsp_gb;
int seq; /**< RTSP command sequence number */ int seq; /**< RTSP command sequence number */
/** copy of RTSPMessageHeader->session_id, i.e. the server-provided session /** copy of RTSPMessageHeader->session_id, i.e. the server-provided session
......
...@@ -383,12 +383,6 @@ static int rtsp_read_close(AVFormatContext *s) ...@@ -383,12 +383,6 @@ static int rtsp_read_close(AVFormatContext *s)
{ {
RTSPState *rt = s->priv_data; RTSPState *rt = s->priv_data;
#if 0
/* NOTE: it is valid to flush the buffer here */
if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
avio_close(&rt->rtsp_gb);
}
#endif
ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL); ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL);
ff_rtsp_close_streams(s); ff_rtsp_close_streams(s);
......
...@@ -58,7 +58,8 @@ FATE = $(FATE_ACODEC) \ ...@@ -58,7 +58,8 @@ FATE = $(FATE_ACODEC) \
$(FATE_SEEK) \ $(FATE_SEEK) \
$(filter-out %-aref,$(FATE_ACODEC)): $(AREF) $(filter-out %-aref,$(FATE_ACODEC)): $(AREF)
$(filter-out %-vref,$(FATE_VCODEC)): $(VREF) $(filter-out %-vref,$(FATE_VSYNTH1)): fate-vsynth1-vref
$(filter-out %-vref,$(FATE_VSYNTH2)): fate-vsynth2-vref
$(FATE_LAVF): $(REFS) $(FATE_LAVF): $(REFS)
$(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF) $(FATE_LAVFI): $(REFS) tools/lavfi-showfiltfmts$(EXESUF)
$(FATE_SEEK): fate-codec fate-lavf libavformat/seek-test$(EXESUF) $(FATE_SEEK): fate-codec fate-lavf libavformat/seek-test$(EXESUF)
......
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