Monday, April 8, 2013

Practice Sets





Practice Set


1. use of volatile and const volatile
2. AAC vs MP3, which is better
3. how to check endianess
4. Shallow copy vs Deep copy
5. Copy Constructor
6. Operator overriding
7. 25 horses 5 racing track and u need to find the fastest three horses in minimum iteration?
8. how does container takes care of AV Sync?
9. Why Audio is master?
10. What is Bayer Image?
11. What is the difference in kmalloc and vmalloc.
12. RTP streaming - frame synchronization and wall clock.
13. OpenMax codec Integration.
14. Copy_from_User and Copy_to_User
15. Use of Neon Instruction
16. Address mapping in device driver
17. pthread, signalling mechanism.
18. structure padding
19. Stagefright A/V Sync.
20. Use of Audio Policy manager.

It's Answer Discussion Time , Please comment your Answers for Favourite Questions!! Hurry Up!!



After getting over with Practice set questions , I dont see any Answers  getting discussed. Ok looks like trivial questions ah

         Answer Time :

1.  use of volatile and const volatile

Both the types are made not to get optimised by compiler.

By defining volatile , its been instructed to compiler not to change variable priority , always check for
its fresh value, Dont pick from cache.

Its best used with the hardware interaction , where we will be having registers to store the state of hw resource.
ex - unsigned int volatile *status_reg;
       unsigned char volatile *reg_addr;
#define set 0x00000001

int res_register_fd( ) {
while((*status_reg&&set) ==0) {
}

return *reg_addr;
}


const identifier with volatile says the register value / variable value can not be modified anytime within the program. It can only be updated by external hardware resource.

So for improving above example for registers storing the hw resource status
we will be declaring variable as :

       unsigned int const volatile *status_reg;
       unsigned char const volatile *reg_addr;


2. AAC is better than MP3 .AAC provides you variable bit rate easily however mp3 would need more effort, better error resilence, better compression , and easy encoding algo. It provides better quality at same bit rate. AAC offers sampling frequencies between 8 kHz and 96 kHz and any number of channels between 1 and 48. Mp3 supports limited channels. AAC has different encoding schemes to provide better compression -

a.AAC - Low Complexity  = AAC/ AAC_LC

b1.HE-AAC v1   aacPlus v1
common name -  eAAC, AAC+, CT-aacPlus
         Encoding - AAC LC + SBR
Standard -
ISO/IEC 14496-3:2001/Amd 1:2003

b2.HE-AAC v2aacPlus v2,  common name - eAAC+, AAC++, Enhanced AAC+
       Encoding - AAC LC + SBR + PS(Parametric Stereo)             
Standard - ISO/IEC 14496-3:2005/Amd 2:2006
c. AAC_ELD -it is a codec targeting speech coding usecases, by meeting the real time requirement of speech codec(low algorithmic delay), as well as providing much better quality than typical AMR-NB/WB codecs that are usually used for speech coding/VOIP apps.




I will make a separate post to discuss more on AAC and different toppings on this - SBR , PS :)


No comments:

Post a Comment