SlideShare a Scribd company logo
MP3 ENCODER CORE
IMPLEMENTATION
Tianyu SuLiu Cheng
University of Ottawa
SUMMARY
• MP3 is originally developed by Fraunhofer IIS partly under EUREKA project
EU147, Digital Audio Broadcasting (DAB). It is then adopted as ISO-
MPEAudioLayer - 3, 1991 (developed followed by Layer 1 and 2).
• MP3 FILE STRUCTURE IS DIVIDED BY 3 PARTS.
TAG.V2→Frame→TAG.V1
TAG.V2
* Version
* Reversion
* Flag etc
TAG.V1
* Title
* Artist
* Album etc
Frame
* IntBitrate
* IntFrequency
* IntLayer etc
University of Ottawa
PRINCIPLES
University of Ottawa
Step 1: Subband Filtering
Down sampling and take advantage of polyphase filterbank
PRINCIPLES
University of Ottawa
Step 2: Psychoacoustic Analysis
Take into account of Threshold in Quiet, Frequency Masking and Temporal Masking
PRINCIPLES
University of Ottawa
Step 3: 18 Point MDCT
Use previous analysis to decide Window Mode and reduce Noise Perception
PRINCIPLES
University of Ottawa
Step 4: Quantization & Bit Allocation
Allocate bits and apply Huffman coding
APPLICATIONS
University of Ottawa
KEY CODES IN SHINE MP3 ENCODER PROGRAM
THIS IS PART OF SHINE FIXED-POINT MP3 ENCODER LIBRARY OPEN PROJECT
("libshine-fxp")
libshine-fxp_20070104/
libshine-fxp /
types.h
types.c
bitstream.h
bitstream.c
Main.c
Layer3.h
Layer3.c
L3subband.h
L3subband.c
L3mdct.h
L3mdct.c
L3loop.h
L3loop.c
L3bitstream.h
L3bitstream.c
APPLICATIONS
University of Ottawa
KEY CODES IN SHINE MP3 ENCODER PROGRAM
types.h
typedef struct { time_t start_time; // define start time of encoding
wave_t wave; // remain the head information of source before encoding
mpeg_t mpeg; // generated head information after encoding
/* These two app-supplied routines are used to read and write data */
int (*get_pcm)(short buffer[2][samp_per_frame], void *config_in);
int (*write_mp3)(long bytes, void *buffer, void *config_in);
} config_t;
bitstream.h
typedef struct bit_stream_struc {
FILE *pt; // pointer to bit stream
unsigned char *buf; // bit stream buffer
int mode; /* bit stream open in read or write mode */
} bitstream_t;
APPLICATIONS
University of Ottawa
KEY CODES IN SHINE MP3 ENCODER PROGRAM
Main.c
#include "Layer3.h"
int main(int argc, char **argv) {
wave_open(&config);
/* set up the read PCM stream and write MP3 stream functions */
config.get_pcm=&wave_get;
config.write_mp3=&write_mp3;
L3_compress(&config);
wave_close(&config);
}
APPLICATIONS
University of Ottawa
KEY CODES IN SHINE MP3 ENCODER PROGRAM
Layer3.c
#include "L3subband.h“
#include "L3mdct.h“
#include "L3loop.h“
#include "L3bitstream.h"
void L3_compress(config_t *config) {
for(gr=0; gr<config.mpeg.granules; gr++) /* polyphase filtering, refered in L3subband.h*/
for(ch=0; ch<config.mpeg.channels; ch++)
for(i=0;i<18;i++)
L3_window_filter_subband(&buffer[ch],&l3_sb_sample[ch][gr+1][i][0]
,ch);
/* apply MDCT to the polyphase output, refered in L3mdct.h */
L3_mdct_sub(l3_sb_sample, mdct_freq); /
bit and noise allocation according to, refered in L3loop.h */
L3_iteration_loop(mdct_freq, &side_info, l3_enc,mean_bits);
/* write the frame to the bitstream, declared in L3bitstream.h */
L3_format_bitstream(l3_enc, &side_info);
}
DEMO
University of Ottawa
Shine MP3 Encoder Open Project
REFERENCES
University of Ottawa
1. Shine Fixed-pt MP3 Encoder Library: Project Web Hosting - Open Source
Software(n.d.). Retrieved November 17, 2014, from http://libshine-
fxp.sourceforge.net
2. Brandenburg K. MP3 and AAC explained[C]//Audio Engineering Society
Conference: 17th International Conference: High-Quality Audio Coding.
Audio Engineering Society, 1999.
3. 张芷燕. MP3 编码法之研究与实现[D]. 台湾国立交通大学, 2002.
4. Noll P. MPnn H G. Genesis of the MP3 audio coding standard[J]. Consumer
Electronics, IEEE Transactions on, 2006, 52(3): 1043-1049EG digital audio
coding[J]. Signal Processing Magazine, IEEE, 1997, 14(5): 59-81.
5. Herre J, Purnhagen H, Breebaart J, et al. The reference model architecture
for MPEG spatial audio coding[C]//Audio Engineering Society Convention
Paper. 2005, 6447: 28-31.

More Related Content

Viewers also liked

Lect5 v2
Lect5 v2Lect5 v2
The effects of visual realism on search tasks in mixed reality simulations-IE...
The effects of visual realism on search tasks in mixed reality simulations-IE...The effects of visual realism on search tasks in mixed reality simulations-IE...
The effects of visual realism on search tasks in mixed reality simulations-IE...
Yadhu Kiran
 
Shopping for MALL
Shopping for MALLShopping for MALL
Shopping for MALL
cdwyer1436
 
Hackware 1.1
Hackware 1.1Hackware 1.1
Hackware 1.1
Kenneth Lim
 
Sameer gupta ppt
Sameer gupta pptSameer gupta ppt
Sameer gupta ppt
abhirulescool
 
Ccss math
Ccss mathCcss math
Ccss math
christinecho21
 
Enviromental
EnviromentalEnviromental
Enviromental
Karolina Wronowska
 
Psychiatric manifestations of Epilepsy
Psychiatric manifestations of EpilepsyPsychiatric manifestations of Epilepsy
Psychiatric manifestations of Epilepsy
Bangabandhu Sheikh Mujib Medical University
 
Karen molina unidad i
Karen molina unidad iKaren molina unidad i
Karen molina unidad i
Karen Molina
 
SIMULATION KILLS FOOTBALL
SIMULATION KILLS FOOTBALLSIMULATION KILLS FOOTBALL
SIMULATION KILLS FOOTBALL
simulationkillsfootball
 
Present1
Present1Present1
Present1bigrio
 
El chocolate
El chocolateEl chocolate
El chocolate
elenarovi
 
Circulating micro rn as in monogenic diabetes
Circulating micro rn as in monogenic diabetesCirculating micro rn as in monogenic diabetes
Circulating micro rn as in monogenic diabetes
Wojciech Fendler
 
"Kuchnia hiszpańska"
"Kuchnia hiszpańska""Kuchnia hiszpańska"
"Kuchnia hiszpańska"
ZSP_Nr_dwa_Krosno
 
บริการต่างๆ ของ ภคพล
บริการต่างๆ ของ ภคพลบริการต่างๆ ของ ภคพล
บริการต่างๆ ของ ภคพลPakapol Somaketarin
 
Tarea sesion 3
Tarea sesion 3Tarea sesion 3
Tarea sesion 3
John Vaquera
 
Atomic structure powerpoint (boundless)
Atomic structure powerpoint (boundless)Atomic structure powerpoint (boundless)
Atomic structure powerpoint (boundless)
stwwilkinson
 
Exploration: Storyboard
Exploration: StoryboardExploration: Storyboard
Exploration: Storyboard
Rachella01
 

Viewers also liked (18)

Lect5 v2
Lect5 v2Lect5 v2
Lect5 v2
 
The effects of visual realism on search tasks in mixed reality simulations-IE...
The effects of visual realism on search tasks in mixed reality simulations-IE...The effects of visual realism on search tasks in mixed reality simulations-IE...
The effects of visual realism on search tasks in mixed reality simulations-IE...
 
Shopping for MALL
Shopping for MALLShopping for MALL
Shopping for MALL
 
Hackware 1.1
Hackware 1.1Hackware 1.1
Hackware 1.1
 
Sameer gupta ppt
Sameer gupta pptSameer gupta ppt
Sameer gupta ppt
 
Ccss math
Ccss mathCcss math
Ccss math
 
Enviromental
EnviromentalEnviromental
Enviromental
 
Psychiatric manifestations of Epilepsy
Psychiatric manifestations of EpilepsyPsychiatric manifestations of Epilepsy
Psychiatric manifestations of Epilepsy
 
Karen molina unidad i
Karen molina unidad iKaren molina unidad i
Karen molina unidad i
 
SIMULATION KILLS FOOTBALL
SIMULATION KILLS FOOTBALLSIMULATION KILLS FOOTBALL
SIMULATION KILLS FOOTBALL
 
Present1
Present1Present1
Present1
 
El chocolate
El chocolateEl chocolate
El chocolate
 
Circulating micro rn as in monogenic diabetes
Circulating micro rn as in monogenic diabetesCirculating micro rn as in monogenic diabetes
Circulating micro rn as in monogenic diabetes
 
"Kuchnia hiszpańska"
"Kuchnia hiszpańska""Kuchnia hiszpańska"
"Kuchnia hiszpańska"
 
บริการต่างๆ ของ ภคพล
บริการต่างๆ ของ ภคพลบริการต่างๆ ของ ภคพล
บริการต่างๆ ของ ภคพล
 
Tarea sesion 3
Tarea sesion 3Tarea sesion 3
Tarea sesion 3
 
Atomic structure powerpoint (boundless)
Atomic structure powerpoint (boundless)Atomic structure powerpoint (boundless)
Atomic structure powerpoint (boundless)
 
Exploration: Storyboard
Exploration: StoryboardExploration: Storyboard
Exploration: Storyboard
 

Similar to Mp3 Encoding Core Implementation

Snort
SnortSnort
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
艾鍗科技
 
Ig2 task 1 work sheet
Ig2 task 1 work sheetIg2 task 1 work sheet
Ig2 task 1 work sheet
eduriez
 
Audio compression
Audio compressionAudio compression
Audio compression
priyanka pandey
 
Ig2 task 1 work sheet
Ig2 task 1 work sheetIg2 task 1 work sheet
Ig2 task 1 work sheet
Adambailey-eccles
 
Konversa.docx - konversa.googlecode.com
Konversa.docx - konversa.googlecode.comKonversa.docx - konversa.googlecode.com
Konversa.docx - konversa.googlecode.com
butest
 
Атаки на видеоконвертеры: год спустя
Атаки на видеоконвертеры: год спустяАтаки на видеоконвертеры: год спустя
Атаки на видеоконвертеры: год спустя
Positive Hack Days
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
Emertxe Information Technologies Pvt Ltd
 
Efficient System Monitoring in Cloud Native Environments
Efficient System Monitoring in Cloud Native EnvironmentsEfficient System Monitoring in Cloud Native Environments
Efficient System Monitoring in Cloud Native Environments
Gergely Szabó
 
Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O
YourHelper1
 
Sound Recording Glossary
Sound Recording GlossarySound Recording Glossary
Sound Recording Glossary
AidenKelly
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
Ajit Nayak
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
Emertxe Information Technologies Pvt Ltd
 
Ai Brt
Ai BrtAi Brt
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
Steve Caron
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
Sysdig
 
Workshop NGS data analysis - 2
Workshop NGS data analysis - 2Workshop NGS data analysis - 2
Workshop NGS data analysis - 2
Maté Ongenaert
 
Optimal Communication Of Real Time Data On Secure Cdma Ip...
Optimal Communication Of Real Time Data On Secure Cdma Ip...Optimal Communication Of Real Time Data On Secure Cdma Ip...
Optimal Communication Of Real Time Data On Secure Cdma Ip...
Stefanie Yang
 
Sip technology overview
Sip technology overviewSip technology overview
Sip technology overview
Oded Ben-Dori
 
MATLAB Audio processing
MATLAB Audio processingMATLAB Audio processing
MATLAB Audio processing
Rohan Datta
 

Similar to Mp3 Encoding Core Implementation (20)

Snort
SnortSnort
Snort
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Ig2 task 1 work sheet
Ig2 task 1 work sheetIg2 task 1 work sheet
Ig2 task 1 work sheet
 
Audio compression
Audio compressionAudio compression
Audio compression
 
Ig2 task 1 work sheet
Ig2 task 1 work sheetIg2 task 1 work sheet
Ig2 task 1 work sheet
 
Konversa.docx - konversa.googlecode.com
Konversa.docx - konversa.googlecode.comKonversa.docx - konversa.googlecode.com
Konversa.docx - konversa.googlecode.com
 
Атаки на видеоконвертеры: год спустя
Атаки на видеоконвертеры: год спустяАтаки на видеоконвертеры: год спустя
Атаки на видеоконвертеры: год спустя
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Efficient System Monitoring in Cloud Native Environments
Efficient System Monitoring in Cloud Native EnvironmentsEfficient System Monitoring in Cloud Native Environments
Efficient System Monitoring in Cloud Native Environments
 
Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O Linux System Programming - Buffered I/O
Linux System Programming - Buffered I/O
 
Sound Recording Glossary
Sound Recording GlossarySound Recording Glossary
Sound Recording Glossary
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Ai Brt
Ai BrtAi Brt
Ai Brt
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Designing Tracing Tools
Designing Tracing ToolsDesigning Tracing Tools
Designing Tracing Tools
 
Workshop NGS data analysis - 2
Workshop NGS data analysis - 2Workshop NGS data analysis - 2
Workshop NGS data analysis - 2
 
Optimal Communication Of Real Time Data On Secure Cdma Ip...
Optimal Communication Of Real Time Data On Secure Cdma Ip...Optimal Communication Of Real Time Data On Secure Cdma Ip...
Optimal Communication Of Real Time Data On Secure Cdma Ip...
 
Sip technology overview
Sip technology overviewSip technology overview
Sip technology overview
 
MATLAB Audio processing
MATLAB Audio processingMATLAB Audio processing
MATLAB Audio processing
 

Recently uploaded

A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 

Recently uploaded (20)

A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 

Mp3 Encoding Core Implementation

  • 1. MP3 ENCODER CORE IMPLEMENTATION Tianyu SuLiu Cheng University of Ottawa
  • 2. SUMMARY • MP3 is originally developed by Fraunhofer IIS partly under EUREKA project EU147, Digital Audio Broadcasting (DAB). It is then adopted as ISO- MPEAudioLayer - 3, 1991 (developed followed by Layer 1 and 2). • MP3 FILE STRUCTURE IS DIVIDED BY 3 PARTS. TAG.V2→Frame→TAG.V1 TAG.V2 * Version * Reversion * Flag etc TAG.V1 * Title * Artist * Album etc Frame * IntBitrate * IntFrequency * IntLayer etc University of Ottawa
  • 3. PRINCIPLES University of Ottawa Step 1: Subband Filtering Down sampling and take advantage of polyphase filterbank
  • 4. PRINCIPLES University of Ottawa Step 2: Psychoacoustic Analysis Take into account of Threshold in Quiet, Frequency Masking and Temporal Masking
  • 5. PRINCIPLES University of Ottawa Step 3: 18 Point MDCT Use previous analysis to decide Window Mode and reduce Noise Perception
  • 6. PRINCIPLES University of Ottawa Step 4: Quantization & Bit Allocation Allocate bits and apply Huffman coding
  • 7. APPLICATIONS University of Ottawa KEY CODES IN SHINE MP3 ENCODER PROGRAM THIS IS PART OF SHINE FIXED-POINT MP3 ENCODER LIBRARY OPEN PROJECT ("libshine-fxp") libshine-fxp_20070104/ libshine-fxp / types.h types.c bitstream.h bitstream.c Main.c Layer3.h Layer3.c L3subband.h L3subband.c L3mdct.h L3mdct.c L3loop.h L3loop.c L3bitstream.h L3bitstream.c
  • 8. APPLICATIONS University of Ottawa KEY CODES IN SHINE MP3 ENCODER PROGRAM types.h typedef struct { time_t start_time; // define start time of encoding wave_t wave; // remain the head information of source before encoding mpeg_t mpeg; // generated head information after encoding /* These two app-supplied routines are used to read and write data */ int (*get_pcm)(short buffer[2][samp_per_frame], void *config_in); int (*write_mp3)(long bytes, void *buffer, void *config_in); } config_t; bitstream.h typedef struct bit_stream_struc { FILE *pt; // pointer to bit stream unsigned char *buf; // bit stream buffer int mode; /* bit stream open in read or write mode */ } bitstream_t;
  • 9. APPLICATIONS University of Ottawa KEY CODES IN SHINE MP3 ENCODER PROGRAM Main.c #include "Layer3.h" int main(int argc, char **argv) { wave_open(&config); /* set up the read PCM stream and write MP3 stream functions */ config.get_pcm=&wave_get; config.write_mp3=&write_mp3; L3_compress(&config); wave_close(&config); }
  • 10. APPLICATIONS University of Ottawa KEY CODES IN SHINE MP3 ENCODER PROGRAM Layer3.c #include "L3subband.h“ #include "L3mdct.h“ #include "L3loop.h“ #include "L3bitstream.h" void L3_compress(config_t *config) { for(gr=0; gr<config.mpeg.granules; gr++) /* polyphase filtering, refered in L3subband.h*/ for(ch=0; ch<config.mpeg.channels; ch++) for(i=0;i<18;i++) L3_window_filter_subband(&buffer[ch],&l3_sb_sample[ch][gr+1][i][0] ,ch); /* apply MDCT to the polyphase output, refered in L3mdct.h */ L3_mdct_sub(l3_sb_sample, mdct_freq); / bit and noise allocation according to, refered in L3loop.h */ L3_iteration_loop(mdct_freq, &side_info, l3_enc,mean_bits); /* write the frame to the bitstream, declared in L3bitstream.h */ L3_format_bitstream(l3_enc, &side_info); }
  • 11. DEMO University of Ottawa Shine MP3 Encoder Open Project
  • 12. REFERENCES University of Ottawa 1. Shine Fixed-pt MP3 Encoder Library: Project Web Hosting - Open Source Software(n.d.). Retrieved November 17, 2014, from http://libshine- fxp.sourceforge.net 2. Brandenburg K. MP3 and AAC explained[C]//Audio Engineering Society Conference: 17th International Conference: High-Quality Audio Coding. Audio Engineering Society, 1999. 3. 张芷燕. MP3 编码法之研究与实现[D]. 台湾国立交通大学, 2002. 4. Noll P. MPnn H G. Genesis of the MP3 audio coding standard[J]. Consumer Electronics, IEEE Transactions on, 2006, 52(3): 1043-1049EG digital audio coding[J]. Signal Processing Magazine, IEEE, 1997, 14(5): 59-81. 5. Herre J, Purnhagen H, Breebaart J, et al. The reference model architecture for MPEG spatial audio coding[C]//Audio Engineering Society Convention Paper. 2005, 6447: 28-31.