The "GR-PEACH_Audio_Playback_7InchLCD_Sample" is a sample code that can provides high-resolution audio playback of FLAC format files. It also allows the user to audio-playback control functions such as play, pause, and stop by manipulating key switches.

Dependencies:   GR-PEACH_video R_BSP TLV320_RBSP USBHost_custom

Fork of GR-PEACH_Audio_Playback_Sample by Renesas

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers fixed.h Source File

fixed.h

00001 /* libFLAC - Free Lossless Audio Codec library
00002  * Copyright (C) 2000-2009  Josh Coalson
00003  * Copyright (C) 2011-2014  Xiph.Org Foundation
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  * notice, this list of conditions and the following disclaimer.
00011  *
00012  * - Redistributions in binary form must reproduce the above copyright
00013  * notice, this list of conditions and the following disclaimer in the
00014  * documentation and/or other materials provided with the distribution.
00015  *
00016  * - Neither the name of the Xiph.org Foundation nor the names of its
00017  * contributors may be used to endorse or promote products derived from
00018  * this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00023  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00027  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00028  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00029  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00030  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  */
00032 
00033 #ifndef FLAC__PRIVATE__FIXED_H
00034 #define FLAC__PRIVATE__FIXED_H
00035 
00036 #ifdef HAVE_CONFIG_H
00037 #include <config.h>
00038 #endif
00039 
00040 #include "private/cpu.h"
00041 #include "private/float.h"
00042 #include "FLAC/format.h"
00043 
00044 /*
00045  *  FLAC__fixed_compute_best_predictor()
00046  *  --------------------------------------------------------------------
00047  *  Compute the best fixed predictor and the expected bits-per-sample
00048  *  of the residual signal for each order.  The _wide() version uses
00049  *  64-bit integers which is statistically necessary when bits-per-
00050  *  sample + log2(blocksize) > 30
00051  *
00052  *  IN data[0,data_len-1]
00053  *  IN data_len
00054  *  OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER]
00055  */
00056 #ifndef FLAC__INTEGER_ONLY_LIBRARY
00057 unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
00058 unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
00059 # ifndef FLAC__NO_ASM
00060 #  if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
00061 #   ifdef FLAC__SSE2_SUPPORTED
00062 unsigned FLAC__fixed_compute_best_predictor_intrin_sse2(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER + 1]);
00063 unsigned FLAC__fixed_compute_best_predictor_wide_intrin_sse2(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER + 1]);
00064 #   endif
00065 #   ifdef FLAC__SSSE3_SUPPORTED
00066 unsigned FLAC__fixed_compute_best_predictor_intrin_ssse3(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
00067 unsigned FLAC__fixed_compute_best_predictor_wide_intrin_ssse3(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER + 1]);
00068 #   endif
00069 #  endif
00070 #  if defined FLAC__CPU_IA32 && defined FLAC__HAS_NASM
00071 unsigned FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
00072 #  endif
00073 # endif
00074 #else
00075 unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
00076 unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
00077 #endif
00078 
00079 /*
00080  *  FLAC__fixed_compute_residual()
00081  *  --------------------------------------------------------------------
00082  *  Compute the residual signal obtained from sutracting the predicted
00083  *  signal from the original.
00084  *
00085  *  IN data[-order,data_len-1]        original signal (NOTE THE INDICES!)
00086  *  IN data_len                       length of original signal
00087  *  IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order
00088  *  OUT residual[0,data_len-1]        residual signal
00089  */
00090 void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[]);
00091 
00092 /*
00093  *  FLAC__fixed_restore_signal()
00094  *  --------------------------------------------------------------------
00095  *  Restore the original signal by summing the residual and the
00096  *  predictor.
00097  *
00098  *  IN residual[0,data_len-1]         residual signal
00099  *  IN data_len                       length of original signal
00100  *  IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order
00101  *  *** IMPORTANT: the caller must pass in the historical samples:
00102  *  IN  data[-order,-1]               previously-reconstructed historical samples
00103  *  OUT data[0,data_len-1]            original signal
00104  */
00105 void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]);
00106 
00107 #endif