#include <stdio.h>#include "vid_sim.h"#include "video_codec.h"Go to the source code of this file.
| Defines | |
| #define | q1 16384 | 
| #define | q2 32768 | 
| #define | q3 49152 | 
| #define | top 65535 | 
| Functions | |
| int | AR_Encode (int index, int cumul_freq[]) | 
| int | bit_opp_bits (int bit) | 
| int | encoder_flush () | 
| int | bit_in_psc_layer (int bit) | 
| int | indexfn (int value, int table[], int max) | 
| Variables | |
| video_codec * | VidSt | 
| long | low = 0 high=top opposite_bits=0 length=0 zerorun=0 | 
| 
 | 
| 
 Definition at line 59 of file vid_sac.c. Referenced by AR_Encode(). | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | 
| 
 | ||||||||||||
| 
 Definition at line 86 of file vid_sac.c. References bit_opp_bits(), bitcount(), low, and q1. Referenced by Code_sac_Coeff(), CodeTCoef(), Count_sac_BitsMB(), and Count_sac_BitsVectors(). 00087 {
00088   int bitcount=0;
00089 
00090   if (index<0) 
00091     return -1; /* Escape Code */
00092 
00093   length = high - low + 1;
00094   high = low - 1 + (length * cumul_freq[index]) / cumul_freq[0];
00095   low += (length * cumul_freq[index+1]) / cumul_freq[0];
00096 
00097   for ( ; ; ) {
00098     if (high < q2) {
00099       bitcount+=bit_opp_bits(0);
00100     }
00101     else if (low >= q2) {
00102       bitcount+=bit_opp_bits(1);        
00103       low -= q2; 
00104       high -= q2;
00105     }
00106     else if (low >= q1 && high < q3) {
00107       opposite_bits += 1; 
00108       low -= q1; 
00109       high -= q1;
00110     }
00111     else break;
00112  
00113     low *= 2; 
00114     high = 2*high+1;
00115   }
00116   return bitcount;
00117 }
 | 
| 
 | 
| 
 Definition at line 190 of file vid_sac.c. References bitcount(), putbits(), video_codec::tf, video_codec::trace, and VidSt. Referenced by bit_opp_bits(). 00191 {
00192   void putbits (int, int);
00193   int bitcount = 0;
00194 
00195   if (zerorun > 13) {
00196     if ((VidSt->trace))
00197       fprintf((VidSt->tf), "PSC emulation ... Bit stuffed.\n");
00198     putbits (1, 1);
00199     bitcount++;
00200     zerorun = 0;
00201   }
00202 
00203   putbits (1, bit);
00204   bitcount++;
00205 
00206   if (bit)
00207     zerorun = 0;
00208   else
00209     zerorun++;
00210 
00211   return bitcount;
00212 }
 | 
| 
 | 
| 
 Definition at line 119 of file vid_sac.c. References bit_in_psc_layer(), and bitcount(). Referenced by AR_Encode(), and encoder_flush(). 00120 {                                   
00121   int bitcount=0;
00122 
00123   bitcount = bit_in_psc_layer(bit);
00124 
00125   while(opposite_bits > 0){
00126     bitcount += bit_in_psc_layer(!bit);
00127     opposite_bits--;
00128   }
00129   return bitcount;
00130 }
 | 
| 
 | 
| 
 Definition at line 150 of file vid_sac.c. References bit_opp_bits(), bitcount(), low, video_codec::tf, video_codec::trace, and VidSt. Referenced by code_video(), and CountBitsSlice(). 00151 {
00152   int bitcount = 0;
00153 
00154   if ((VidSt->trace))
00155     fprintf((VidSt->tf), "encoder_flush:\n");
00156 
00157   opposite_bits++;
00158   if (low < q1) {
00159     bitcount+=bit_opp_bits(0);
00160   }
00161   else {
00162     bitcount+=bit_opp_bits(1);
00163   }
00164   low = 0; 
00165   high = top;
00166 
00167   zerorun=0;
00168 
00169   return bitcount;
00170 }
 | 
| 
 | ||||||||||||||||
| 
 Definition at line 233 of file vid_sac.c. Referenced by Code_sac_Coeff(), Count_sac_BitsMB(), and Count_sac_BitsVectors(). 00234 {
00235   int n=0;
00236 
00237   while(1) {
00238     if (table[n++]==value) return n-1;
00239     if (n>max) return -1;
00240   }
00241 
00242 }
 | 
| 
 | 
| 
 Definition at line 64 of file vid_sac.c. Referenced by AR_Encode(), and encoder_flush(). | 
| 
 | 
| 
 Definition at line 16 of file vid_wrapper.c. | 
 1.3.9.1
 1.3.9.1