[FFmpeg-soc] [soc]: r3607 - in nellyenc: checkout.sh ffmpeg.patch lowpass.c lowpass.h lowpass2.c lowpass2.h nellymoserenc.c
bwolowiec
subversion at mplayerhq.hu
Mon Aug 25 11:11:13 CEST 2008
Author: bwolowiec
Date: Mon Aug 25 11:11:13 2008
New Revision: 3607
Log:
update to r14965
Added:
nellyenc/lowpass2.c
- copied, changed from r3446, /nellyenc/lowpass.c
nellyenc/lowpass2.h
- copied unchanged from r3446, /nellyenc/lowpass.h
Removed:
nellyenc/lowpass.c
nellyenc/lowpass.h
Modified:
nellyenc/checkout.sh
nellyenc/ffmpeg.patch
nellyenc/nellymoserenc.c
Modified: nellyenc/checkout.sh
==============================================================================
--- nellyenc/checkout.sh (original)
+++ nellyenc/checkout.sh Mon Aug 25 11:11:13 2008
@@ -1,11 +1,11 @@
#!/bin/sh
-FILES="nellymoserenc.c lowpass.c lowpass.h"
+FILES="nellymoserenc.c lowpass2.c lowpass2.h"
echo "checking out ffmpeg svn"
for i in $FILES Makefile allcodecs.c; do
rm -f ffmpeg/libavcodec/$i
done
-svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 14909
+svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk/ ffmpeg -r 14965
echo "patching ffmpeg"
cd ffmpeg
patch -p0 <../ffmpeg.patch
Modified: nellyenc/ffmpeg.patch
==============================================================================
--- nellyenc/ffmpeg.patch (original)
+++ nellyenc/ffmpeg.patch Mon Aug 25 11:11:13 2008
@@ -6,7 +6,7 @@ Index: libavcodec/Makefile
OBJS-$(CONFIG_MSVIDEO1_DECODER) += msvideo1.o
OBJS-$(CONFIG_MSZH_DECODER) += lcldec.o
OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o mdct.o fft.o
-+OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o mdct.o fft.o lowpass.o
++OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o mdct.o fft.o lowpass2.o
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
OBJS-$(CONFIG_PAM_ENCODER) += pnmenc.o pnm.o
OBJS-$(CONFIG_PBM_ENCODER) += pnmenc.o pnm.o
Copied: nellyenc/lowpass2.c (from r3446, /nellyenc/lowpass.c)
==============================================================================
--- /nellyenc/lowpass.c (original)
+++ nellyenc/lowpass2.c Mon Aug 25 11:11:13 2008
@@ -22,7 +22,7 @@
*/
#include "avcodec.h"
-#include "lowpass.h"
+#include "lowpass2.h"
#include <complex.h>
void ff_lowpass_init(LPFilterContext *s, float sample_rate, float fpass, float fstop, float apass, float astop){
Modified: nellyenc/nellymoserenc.c
==============================================================================
--- nellyenc/nellymoserenc.c (original)
+++ nellyenc/nellymoserenc.c Mon Aug 25 11:11:13 2008
@@ -37,57 +37,14 @@
#include "nellymoser.h"
#include "avcodec.h"
#include "dsputil.h"
-#include "lowpass.h"
+#include "lowpass2.h"
+
+#define BITSTREAM_WRITER_LE
+#include "bitstream.h"
#define MAX_POW_CACHED (1<<11)
#define LOWPASS 1
-/*
- * FIXME: Bitstream from vorbis_enc.c (move to seperate file?)
- */
-typedef struct {
- int total;
- int total_pos;
- int pos;
- uint8_t * buf_ptr;
-} PutBitContext2;
-
-static inline void init_put_bits2(PutBitContext2 * pb, uint8_t * buf, int buffer_len) {
- pb->total = buffer_len * 8;
- pb->total_pos = 0;
- pb->pos = 0;
- pb->buf_ptr = buf;
-}
-
-static void put_bits2(PutBitContext2 * pb, int bits, uint64_t val) {
- if ((pb->total_pos += bits) >= pb->total) return;
- if (!bits) return;
- if (pb->pos) {
- if (pb->pos > bits) {
- *pb->buf_ptr |= val << (8 - pb->pos);
- pb->pos -= bits;
- bits = 0;
- } else {
- *pb->buf_ptr++ |= (val << (8 - pb->pos)) & 0xFF;
- val >>= pb->pos;
- bits -= pb->pos;
- pb->pos = 0;
- }
- }
- for (; bits >= 8; bits -= 8) {
- *pb->buf_ptr++ = val & 0xFF;
- val >>= 8;
- }
- if (bits) {
- *pb->buf_ptr = val;
- pb->pos = 8 - bits;
- }
-}
-
-static inline int put_bits2_count(PutBitContext2 * pb) {
- return pb->total_pos;
-}
-
typedef struct NellyMoserEncodeContext {
AVCodecContext* avctx;
DECLARE_ALIGNED_16(float,float_buf[3*NELLY_BUF_LEN]);
@@ -198,7 +155,7 @@ static av_cold int encode_end(AVCodecCon
static void encode_block(NellyMoserEncodeContext *s,
unsigned char *buf, int buf_size, float *samples){
- PutBitContext2 pb;
+ PutBitContext pb;
int bits[NELLY_BUF_LEN];
int i, j, k, l, b;
int bk;
@@ -218,7 +175,7 @@ static void encode_block(NellyMoserEncod
s->float_buf[i]);
}
- init_put_bits2(&pb, buf, buf_size*8);
+ init_put_bits(&pb, buf, buf_size*8);
band_start = 0;
band_end = ff_nelly_band_sizes_table[0];
@@ -236,12 +193,12 @@ static void encode_block(NellyMoserEncod
if(i){
tmp -= val;
find_best_value(tmp, ff_nelly_delta_table, 32, bk);
- put_bits2(&pb, 5, bk);
+ put_bits(&pb, 5, bk);
val += ff_nelly_delta_table[bk];
}else{
//base exponent
find_best_value(tmp, ff_nelly_init_table, 64, bk);
- put_bits2(&pb, 6, bk);
+ put_bits(&pb, 6, bk);
val = ff_nelly_init_table[bk];
}
@@ -271,18 +228,18 @@ static void encode_block(NellyMoserEncod
find_best_value(tmp,
(ff_nelly_dequantization_table + (1<<bits[j])-1),
(1<<bits[j]), bk);
- put_bits2(&pb, bits[j], bk);
+ put_bits(&pb, bits[j], bk);
}
}
av_log(s->avctx, AV_LOG_DEBUG, "count=%i (%i)\n",
- put_bits2_count(&pb),
+ put_bits_count(&pb),
NELLY_HEADER_BITS + NELLY_DETAIL_BITS
);
if(!i)
- put_bits2(&pb, NELLY_HEADER_BITS + NELLY_DETAIL_BITS - put_bits2_count(&pb) , 0);
+ put_bits(&pb, NELLY_HEADER_BITS + NELLY_DETAIL_BITS - put_bits_count(&pb) , 0);
av_log(s->avctx, AV_LOG_DEBUG, "count=%i (%i)\n",
- put_bits2_count(&pb),
+ put_bits_count(&pb),
NELLY_HEADER_BITS + NELLY_DETAIL_BITS
);
}
More information about the FFmpeg-soc
mailing list