Displaying 20 results from an estimated 80 matches for "cbits".
Did you mean:
bits
2008 Mar 14
2
bitreader optimizations
...eft to read to finish a rice codeword */
-
/* try and get br->consumed_words and br->consumed_bits into register;
* must remember to flush them back to *br before calling other
- * bitwriter functions that use them, and before returning */
- register unsigned cwords;
- register unsigned cbits;
+ * bitreader functions that use them, and before returning */
+ unsigned cwords, words, lsbs, msbs, x, y;
+ unsigned ucbits; /* keep track of the number of unconsumed bits in word */
+ brword b;
+ int *val, *end;
FLAC__ASSERT(0 != br);
FLAC__ASSERT(0 != br->buffer);
/* WATCHOUT: code...
2012 May 04
0
[PATCH] Optimize FLAC__bitreader_read_rice_signed
...eft to read to finish a rice codeword */
-
/* try and get br->consumed_words and br->consumed_bits into register;
* must remember to flush them back to *br before calling other
- * bitwriter functions that use them, and before returning */
- register unsigned cwords;
- register unsigned cbits;
+ * bitreader functions that use them, and before returning */
+ unsigned cwords, words, lsbs, msbs, x, y;
+ unsigned ucbits; /* keep track of the number of unconsumed bits in word */
+ uint32_t b;
+ int *val, *end;
FLAC__ASSERT(0 != br);
FLAC__ASSERT(0 != br->buffer);
/* WATCHOUT: cod...
2008 Mar 17
0
bitreader optimizations
...eft to read to finish a rice codeword */
-
/* try and get br->consumed_words and br->consumed_bits into register;
* must remember to flush them back to *br before calling other
- * bitwriter functions that use them, and before returning */
- register unsigned cwords;
- register unsigned cbits;
+ * bitreader functions that use them, and before returning */
+ unsigned cwords, words, lsbs, msbs, x, y;
+ unsigned ucbits; /* keep track of the number of unconsumed bits in word */
+ brword b;
+ int *val, *end;
FLAC__ASSERT(0 != br);
FLAC__ASSERT(0 != br->buffer);
/* WATCHOUT: code...
2012 Aug 28
3
[PATCH 1/3] Make FLAC__clz_soft_uint32 static.
---
src/libFLAC/include/private/bitmath.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/libFLAC/include/private/bitmath.h b/src/libFLAC/include/private/bitmath.h
index 61b0e03..d32b1a7 100644
--- a/src/libFLAC/include/private/bitmath.h
+++ b/src/libFLAC/include/private/bitmath.h
@@ -42,7 +42,7 @@
#endif
/* Will never be emitted for MSVC, GCC, Intel compilers */
2004 Sep 10
4
bitbuffer optimizations
...xffff ? byte_to_unary_table[(blurb) >> 8] + 16 : ((blurb) <= 0xffffff ? byte_to_unary_table[(blurb) >> 16] + 8 : byte_to_unary_table[(blurb) >> 24])))
#else
/* ERROR, only sizes of 8 and 32 are supported */
#endif
@@ -2090,114 +2111,16 @@
if(nvals == 0)
return true;
+ cbits = bb->consumed_bits;
i = bb->consumed_blurbs;
- /*
- * We unroll the main loop to take care of partially consumed blurbs here.
- */
- if(bb->consumed_bits > 0) {
- save_blurb = blurb = buffer[i];
- cbits = bb->consumed_bits;
- blurb <<= cbits;
-
- while(1) {
- if(stat...
2005 Jan 01
2
libFLAC bitbuffer optimizations
...ry_table[(blurb) >> 8] + 16 \
+ : ((blurb) <=0xffffff \
+ ? byte_to_unary_table[(blurb) >> 16] + 8 \
+ : byte_to_unary_table[(blurb) >> 24])))
#else
/* ERROR, only sizes of 8 and 32 are supported */
#endif
@@ -2109,114 +2135,18 @@
if(nvals == 0)
return true;
+ cbits = bb->consumed_bits;
i = bb->consumed_blurbs;
- /*
- * We unroll the main loop to take care of partially consumed blurbs here.
- */
- if(bb->consumed_bits > 0) {
- save_blurb = blurb = buffer[i];
- cbits = bb->consumed_bits;
- blurb <<= cbits;
-
- while(1) {
- if(stat...
2004 Dec 28
2
libFLAC bitbuffer optimizations
Pulled from my Arch archive, this following patch seems to have made
quite a difference in getting my ARM7TDMI chip to play FLAC (compression
levels 0-2) on my ipod. I don't have benchmarks with hard numbers, but
playing with skips vs playing without skips is a fairly noticeable
difference.
memcpy and memset on uClibc are optimized in asm for the ARM7TDMI in
uClibc. Other hardware/libc
2011 Nov 17
1
Just getting noise
...,
size_t& outputSize)
{
speex_bits_reset(&mBits);
speex_encode_int(mState, (Enigma::s16*)inputBuffer, &mBits);
speex_bits_insert_terminator(&mBits);
outputSize = speex_bits_nbytes(&mBits);
/*Copy the bits to an array of char that can be written*/
Enigma::u8* cbits = new Enigma::u8[outputSize]();
speex_bits_write(&mBits, (char*)cbits, outputSize);
return cbits;
}
virtual Enigma::u8* Decode(Enigma::u8* inputBuffer,size_t inputSize,
size_t& outputSize)
{
speex_bits_reset(&mBits);
speex_bits_read_from(&mBits, (char*)inputBuffe...
2005 Dec 06
1
problems decoding speex... please help
...g to decode speex using version 1.1.10's libspeex with
fixed_point enabled. copied the sample in the manual (1.1.11) with minor
revisions. While running the program, encountered this warning:
"Packet is larger than allocated buffer : 38"
when calling speex_bits_read_from (&bits, cbits, nBytes)
then my program terminated unexpectedly with errors (Unhandled exception at
0x10225e1f ( msvcr80d.dll) in sampleDEC.exe: 0xC0000005: Access violation
reading location 0x645c3a63.)
I declared cbits as char *cbits [500]. nBytes is 38, bit rate is 15000 bps.
I'm decoding a 'speex...
2004 Aug 06
1
About reducing noise..
...fer
// convert to short
for ( int i = 0; i < FRAME_SIZE; i++)
in[i] = out_buffer[i];
speex_bits_reset(&bits);
// encode
speex_encode ( state, in, &bits);
// copy bits to an array of chars
nbBytes = speex_bits_write ( &bits, cbits, 200);
// copy these cbits into a buffer
CopyBuffer(pBuffer + dwLength, cbits, nbBytes);
dwLength += nbBytes;
}
// uninitialize
For decoding .
SpeexBits bits;
int i, tmp;
state = speex_decoder_init(&speex_nb_mode);
tmp =1;
speex_decoder_ctl(state, SPEEX_SET_ENH, &...
2011 Nov 16
2
Just getting noise
...;
for (i=0;i<(inputSize/2);i++)
{
input[i]=in[i];
}
/*Flush all the bits in the struct so we can encode a new frame*/
speex_bits_reset(&mBits);
/*Encode the frame*/
speex_encode(mState, input, &mBits);
nbBytes = speex_bits_nbytes(&mBits);
char* cbits = new char[nbBytes]();
/*Copy the bits to an array of char that can be written*/
nbBytes = speex_bits_write(&mBits, cbits, nbBytes);
outputSize=nbBytes;
delete[] input;
return (Enigma::u8*)cbits;
}
virtual Enigma::u8* Decode(Enigma::u8* inputBuffer,size_t inputSize,
s...
2005 Oct 17
6
Error Executing sampledec in VC++
...ex_nb_mode);
// Set default options for decoding:
temp = 1;
speex_decoder_ctl(decstate, SPEEX_SET_ENH, &temp);
// Initialize spxbits (structure SpeexBits)
speex_bits_init (&spxbits);
while (!(feof(fo))) // this is where the problem starts
{
fread (&nbBytes, sizeof(int), 1, fo);
fread (cbits, 1, nbBytes, fo);
cout << "1"; // just to see whether the loop iterates
speex_bits_read_from (&spxbits, cbits, nbBytes);
speex_decode (decstate, &spxbits, pcm);
// Copy 1 frame from float pcm to short spx
for (n=0; n<FRAME_SIZE; n++)
spx [n] = pcm [n];
fwrite (spx, s...
2004 Aug 06
2
decode in ppc 2003
...e[]="test.spx";
char outfile[]="test.wav";
char *outFile;
char *inFile;
FILE *fout; // output file
FILE *fin; // input file
short out[FRAME_SIZE];
short output[FRAME_SIZE];
char cbits[200];
int nbBytes;
void *state;
SpeexBits bits;
int i, tmp;
state = speex_decoder_init(&speex_nb_mode);
tmp=1;
speex_decoder_ctl(state, SPEEX_SET_ENH, &tmp);
outFile = outfile;...
2004 Aug 06
1
decode in ppc 2003
Hi,
My problem is at the second fread function,
fread(&nbBytes, sizeof(int), 1, fin); //the first fread
fread(cbits,1, nbBytes, fin);// the second fread.
When I'm debugging always nbytes is greater than cbits. This give me a
execution error.
Thanks.
Rodrigo.
<p><p><p>-----Mensaje original-----
De: owner-speex-dev@xiph.org [mailto:owner-speex-dev@xiph.org] En nombre de
Jean-Marc Valin
Env...
2011 Dec 22
2
Decoding only a certain frame results in different values than when decoding the entire file
...le;
//FILE *ftest;
//testFile = "test";
//ftest = fopen(testFile, "wb");
//fwrite(inBuf,1,inlen,ftest);
//take every 320 bytes
//copy every short to float array, and make sure to put null in
unused area
float input[MAX_FRAME_SIZE];
char cbits[MAX_FRAME_BYTES];
unsigned int inBufpos = 0, j, outBufpos = 0;
short *sinBuf;
sinBuf = (short*) inBuf;
do
{
j = 0;
do
{
//copy to float array
input[j] = sinBuf[inBufpos];
inBufpos++; j++;
}...
2006 Oct 12
1
Problem with encoding and decoding
...#include <sys/soundcard.h>
/*The frame size in hardcoded for this sample code but it doesn't have
to be*/
#define FRAME_SIZE 160
#define false -1
int card;
int main(int argc, char **argv)
{
//char *inFile;
FILE *fin;
short in[FRAME_SIZE];
float input[FRAME_SIZE];
char cbits[200];
int nbBytes;
/*Holds the state of the encoder*/
void *state;
/*Holds bits so they can be read and written to by the Speex routines*/
SpeexBits bits;
int i, tmp;
char file[100];
int channels,format;
while (argc>1){
argc--;
argv++;
if(!...
2005 Oct 17
3
Error Executing sampledec in VC++
...t I read a file
stream instead of stdin)
#include "speex/speex.h"
#include <stdio.h>
#include <iostream.h>
void main ()
{
// Definitions
#define FRAME_SIZE 160
#define FIXED_POINT
// Variable Declarations
FILE *fo, *fs;
short spx [FRAME_SIZE];
float pcm [FRAME_SIZE];
char cbits [200];
int nbBytes, n, temp;
void *decstate;
SpeexBits spxbits;
// Program starts here:
cout << "Starting spxdec...\n";
fo = fopen("samp.spx","rb");
if (fo == NULL)
cout << "Error!\n";
else
cout << "Okay!\n";
fs = fopen ("...
2007 Feb 13
1
Hello Guys
...=====
#include "speex.h"
#include <stdio.h>
/*The frame size in hardcoded for this sample code but it doesn't have to be*/
#define FRAME_SIZE 160
int main(int argc, char **argv)
{
char *inFile;
FILE *fin;
FILE *fout;
short in[FRAME_SIZE];
float input[FRAME_SIZE];
char cbits[200];
int nbBytes;
/*Holds the state of the encoder*/
void *state;
/*Holds bits so they can be read and written to by the Speex routines*/
SpeexBits bits;
int i, tmp;
/*Create a new encoder state in narrowband mode*/
state = speex_encoder_init(&speex_nb_mode);
/*Set the quality to 8 (1...
2011 Nov 16
2
Just getting noise
...s in the struct so we can
encode a new frame*/
? ? ? ? ? ? ? ? ? ? ? ?speex_bits_reset(&bits);
? ? ? ? ? ? ? ? ? ? ? ?/*Encode the frame*/
? ? ? ? ? ? ? ? ? ? ? ?speex_encode(state, input, &bits);
? ? ? ? ? ? ? ? ? ? ? ?nbBytes = speex_bits_nbytes(&bits);
? ? ? ? ? ? ? ? ? ? ? ?char* cbits = new char[nbBytes]();
? ? ? ? ? ? ? ? ? ? ? ?/*Copy the bits to an array of char that can be written*/
? ? ? ? ? ? ? ? ? ? ? ?nbBytes = speex_bits_write(&bits, cbits, nbBytes);
? ? ? ? ? ? ? ? ? ? ? ?/*Destroy the encoder state*/
? ? ? ? ? ? ? ? ? ? ? ?speex_encoder_destroy(state);
? ? ? ? ?...
2012 Mar 14
0
Audio file is corrupted after decoding
...artDm_ISmartDMActivity_spxEnc(JNIEnv * env, jobject
jobj,jstring dir1,jstring dir2)
{
const char *inFile= (*env)->GetStringUTFChars(env,dir1,0);
const char *outFile= (*env)->GetStringUTFChars(env,dir2,0);
FILE *fin;
FILE *fout;
short in[FRAME_SIZE];
float input[FRAME_SIZE];
char cbits[360];
int nbBytes;
void *state;
SpeexBits bits;
int i, tmp;
state = speex_encoder_init(&speex_wb_mode);
tmp=8;
speex_encoder_ctl(state, SPEEX_SET_QUALITY, &tmp);
fin = fopen(inFile, "r");
fout=fopen(outFile,"w");
speex_bits_init(&bits);...