]> git.sesse.net Git - vlc/commitdiff
* audio_decoder/audio_decoder.c :
authorMichel Kaempf <maxx@videolan.org>
Fri, 24 Sep 1999 10:02:11 +0000 (10:02 +0000)
committerMichel Kaempf <maxx@videolan.org>
Fri, 24 Sep 1999 10:02:11 +0000 (10:02 +0000)
- Int�gration totale et non comment�e du support de la synchro ;
- Le probl�me du 0.1% de CPU -> 9.7% est r�solu en compilant avec un
flag d'optimisation (cf ci-dessous) ;

* Makefile :
- Rajout d'une ligne *comment�e* avec le flag d'optimisation -O2 ;
- En -O2 et en faisant tourner le mini-server et un vlc --novideo sur la
meme machine, la somme des %CPU du vlc et du mini-server est �gale � 0 :-)
C'est pas beau �a ?

-- MaXX "vlc rewlz"

Makefile
src/audio_decoder/audio_decoder.c

index 759a0acb9c3f0a132c46d7167b5a59d5251606d8..7c0474272ebc3f66c85ac68241627f0bc06b7d8d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,7 @@ CCFLAGS += -D_REENTRANT
 CCFLAGS += -D_GNU_SOURCE
 
 # Optimizations : don't compile debug versions with them
+#CCFLAGS += -O2
 #CCFLAGS += -O8
 #CCFLAGS += -s -fargument-noalias-global -fexpensive-optimizations -ffast-math -funroll-loops -fomit-frame-pointer #-march=pentiumpro
 #(Uncomment -march=pentiumpro if it applies)
index a1af8cf14fbfe9ff305f0a675eb08becb9c2e0b7..92b598a0973fb839f07dd0f855ad72a0fc8e39c6 100644 (file)
@@ -838,17 +838,20 @@ static void RunThread( adec_thread_t * p_adec )
     {
         switch ( (p_adec->bit_stream.fifo.buffer & ADEC_HEADER_LAYER_MASK) >> ADEC_HEADER_LAYER_SHIFT )
         {
+            /* Reserved */
             case 0:
                 intf_DbgMsg("adec debug: layer == 0 (reserved)\n");
                 p_adec->bit_stream.fifo.buffer = 0;
                 p_adec->bit_stream.fifo.i_available = 0;
                 break;
 
+            /* Layer III */
             case 1:
                 p_adec->bit_stream.fifo.buffer = 0;
                 p_adec->bit_stream.fifo.i_available = 0;
                 break;
 
+            /* Layer II */
             case 2:
                 if ( (p_adec->bit_stream.fifo.buffer & ADEC_HEADER_MODE_MASK) == ADEC_HEADER_MODE_MASK )
                 {
@@ -873,11 +876,13 @@ static void RunThread( adec_thread_t * p_adec )
 //                        p_adec->bank_1.v2[ i_dummy ] = .0;
 //                    }
 
+                    /* Waiting until there is enough free space in the audio output fifo
+                     * in order to store the new decoded frames */
                     pthread_mutex_lock( &p_adec->p_aout_fifo->data_lock );
                     /* adec_Layer2_Stereo() produces 6 output frames (2*1152/384)...
-                     * If these 6 frames would be recorded in the audio output fifo,
-                     * the l_end_frame index would be incremented 6 times. But, if after
-                     * this operation the audio output fifo would contain less than 6 frames,
+                     * If these 6 frames were recorded in the audio output fifo, the
+                     * l_end_frame index would be incremented 6 times. But, if after
+                     * this operation the audio output fifo contains less than 6 frames,
                      * it would mean that we had not enough room to store the 6 frames :-P */
                     while ( (((p_adec->p_aout_fifo->l_end_frame + 6) - p_adec->p_aout_fifo->l_start_frame) & AOUT_FIFO_SIZE) < 6 ) /* !! */
                     {
@@ -885,6 +890,7 @@ static void RunThread( adec_thread_t * p_adec )
                     }
                     pthread_mutex_unlock( &p_adec->p_aout_fifo->data_lock );
 
+                    /* Decoding the frames */
                     if ( adec_Layer2_Stereo(p_adec) )
                     {
                         pthread_mutex_lock( &p_adec->p_aout_fifo->data_lock );
@@ -907,14 +913,15 @@ static void RunThread( adec_thread_t * p_adec )
                         p_adec->p_aout_fifo->date[p_adec->p_aout_fifo->l_end_frame] = LAST_MDATE;
                         p_adec->p_aout_fifo->l_end_frame = (p_adec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE;
                         pthread_mutex_unlock( &p_adec->p_aout_fifo->data_lock );
-                        date += 24000;
 /*
-                        UPDATE_INCREMENT( date_increment, date )
+                        date += 24000;
 */
+                        UPDATE_INCREMENT( date_increment, date )
                     }
                 }
                 break;
 
+            /* Layer I */
             case 3:
                 if ( (p_adec->bit_stream.fifo.buffer & ADEC_HEADER_MODE_MASK) == ADEC_HEADER_MODE_MASK )
                 {