summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/Makefile4
-rw-r--r--libavcodec/aaccoder.c24
-rw-r--r--libavcodec/aacenc.c16
-rw-r--r--libavcodec/aacenc.h1
-rw-r--r--libavcodec/ac3enc.c2
-rw-r--r--libavcodec/utils.c1
-rw-r--r--libavcodec/x86/dsputil_mmx.c4
-rw-r--r--libavcodec/x86/mlpdsp.c6
8 files changed, 36 insertions, 22 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b6103af..5dcdeea 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -666,7 +666,7 @@ OBJS-$(CONFIG_MLIB) += mlib/dsputil_mlib.o \
# well.
OBJS-$(!CONFIG_SMALL) += inverse.o
--include $(SUBDIR)$(ARCH)/Makefile
+-include $(SRC_PATH)/$(SUBDIR)$(ARCH)/Makefile
SKIPHEADERS += %_tablegen.h \
%_tables.h \
@@ -693,7 +693,7 @@ DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
-include $(SUBDIR)../subdir.mak
+include $(SRC_PATH)/subdir.mak
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index a68aa02..4eba5dd 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -433,10 +433,26 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce,
for (swb = 0; swb < max_sfb; swb++) {
size = sce->ics.swb_sizes[swb];
if (sce->zeroes[win*16 + swb]) {
- for (cb = 0; cb < 12; cb++) {
- path[swb+1][cb].prev_idx = cb;
- path[swb+1][cb].cost = path[swb][cb].cost;
- path[swb+1][cb].run = path[swb][cb].run + 1;
+ float cost_stay_here = path[swb][0].cost;
+ float cost_get_here = next_minrd + run_bits + 4;
+ if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run]
+ != run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1])
+ cost_stay_here += run_bits;
+ if (cost_get_here < cost_stay_here) {
+ path[swb+1][0].prev_idx = next_mincb;
+ path[swb+1][0].cost = cost_get_here;
+ path[swb+1][0].run = 1;
+ } else {
+ path[swb+1][0].prev_idx = 0;
+ path[swb+1][0].cost = cost_stay_here;
+ path[swb+1][0].run = path[swb][0].run + 1;
+ }
+ next_minrd = path[swb+1][0].cost;
+ next_mincb = 0;
+ for (cb = 1; cb < 12; cb++) {
+ path[swb+1][cb].cost = 61450;
+ path[swb+1][cb].prev_idx = -1;
+ path[swb+1][cb].run = 0;
}
} else {
float minrd = next_minrd;
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 0de6622..2a6dbc8 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -208,8 +208,9 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
ff_init_ff_sine_windows(10);
ff_init_ff_sine_windows(7);
+ s->chan_map = aac_chan_configs[avctx->channels-1];
s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));
- s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);
+ s->cpe = av_mallocz(sizeof(ChannelElement) * s->chan_map[0]);
avctx->extradata = av_mallocz(5 + FF_INPUT_BUFFER_PADDING_SIZE);
avctx->extradata_size = 5;
put_audio_specific_config(avctx);
@@ -500,7 +501,6 @@ static int aac_encode_frame(AVCodecContext *avctx,
int16_t *samples = s->samples, *samples2, *la;
ChannelElement *cpe;
int i, ch, w, g, chans, tag, start_ch;
- const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];
int chan_el_counter[4];
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
@@ -521,8 +521,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
} else {
start_ch = 0;
samples2 = s->samples + 1024 * avctx->channels;
- for (i = 0; i < chan_map[0]; i++) {
- tag = chan_map[i+1];
+ for (i = 0; i < s->chan_map[0]; i++) {
+ tag = s->chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
ff_psy_preprocess(s->psypp,
(uint16_t*)data + channel_maps[avctx->channels-1][start_ch],
@@ -538,9 +538,9 @@ static int aac_encode_frame(AVCodecContext *avctx,
}
start_ch = 0;
- for (i = 0; i < chan_map[0]; i++) {
+ for (i = 0; i < s->chan_map[0]; i++) {
FFPsyWindowInfo* wi = windows + start_ch;
- tag = chan_map[i+1];
+ tag = s->chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
cpe = &s->cpe[i];
for (ch = 0; ch < chans; ch++) {
@@ -580,9 +580,9 @@ static int aac_encode_frame(AVCodecContext *avctx,
put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);
start_ch = 0;
memset(chan_el_counter, 0, sizeof(chan_el_counter));
- for (i = 0; i < chan_map[0]; i++) {
+ for (i = 0; i < s->chan_map[0]; i++) {
FFPsyWindowInfo* wi = windows + start_ch;
- tag = chan_map[i+1];
+ tag = s->chan_map[i+1];
chans = tag == TYPE_CPE ? 2 : 1;
cpe = &s->cpe[i];
put_bits(&s->pb, 3, tag);
diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index 44ad50b..1e27ddc 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -61,6 +61,7 @@ typedef struct AACEncContext {
int16_t *samples; ///< saved preprocessed input
int samplerate_index; ///< MPEG-4 samplerate index
+ uint8_t *chan_map; ///< channel configuration map
ChannelElement *cpe; ///< channel elements
FFPsyContext psy;
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index cd9f8d1..9b0ee2d 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -306,8 +306,6 @@ static av_cold void exponent_init(AC3EncodeContext *s)
/**
* Extract exponents from the MDCT coefficients.
- * This takes into account the normalization that was done to the input samples
- * by adjusting the exponents by the exponent shift values.
*/
static void extract_exponents(AC3EncodeContext *s)
{
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 165ef5b..fd011cf 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -26,7 +26,6 @@
*/
#include "libavutil/avstring.h"
-#include "libavutil/integer.h"
#include "libavutil/crc.h"
#include "libavutil/pixdesc.h"
#include "libavutil/audioconvert.h"
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index ec4d0dc..78cad4c 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -580,7 +580,7 @@ static void add_bytes_mmx(uint8_t *dst, uint8_t *src, int w){
dst[i+0] += src[i+0];
}
-#if HAVE_7REGS && HAVE_TEN_OPERANDS
+#if HAVE_7REGS
static void add_hfyu_median_prediction_cmov(uint8_t *dst, const uint8_t *top, const uint8_t *diff, int w, int *left, int *left_top) {
x86_reg w2 = -w;
x86_reg x;
@@ -2577,7 +2577,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_mmx2;
#endif
-#if HAVE_7REGS && HAVE_TEN_OPERANDS
+#if HAVE_7REGS
if( mm_flags&AV_CPU_FLAG_3DNOW )
c->add_hfyu_median_prediction = add_hfyu_median_prediction_cmov;
#endif
diff --git a/libavcodec/x86/mlpdsp.c b/libavcodec/x86/mlpdsp.c
index 486a927..7ea77fc 100644
--- a/libavcodec/x86/mlpdsp.c
+++ b/libavcodec/x86/mlpdsp.c
@@ -23,7 +23,7 @@
#include "libavcodec/dsputil.h"
#include "libavcodec/mlp.h"
-#if HAVE_7REGS && HAVE_TEN_OPERANDS
+#if HAVE_7REGS
extern void ff_mlp_firorder_8;
extern void ff_mlp_firorder_7;
@@ -171,11 +171,11 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
);
}
-#endif /* HAVE_7REGS && HAVE_TEN_OPERANDS */
+#endif /* HAVE_7REGS */
void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx)
{
-#if HAVE_7REGS && HAVE_TEN_OPERANDS
+#if HAVE_7REGS
c->mlp_filter_channel = mlp_filter_channel_x86;
#endif
}
OpenPOWER on IntegriCloud