Θα έχεις global πίνακες AC, DC στους οποίους θα αναθέτεις είτε τους πίνακες yAC, yDC είτε τους cAC, cDC πριν καλέσεις την εκάστοτε συνάρτηση. Η συναρτήσεις σου θα χρησιμοποιούν μόνο τους AC, DC.
Ok this makes sense...
Ευχαριστώ
UPDATE: καινούργιο αρχείο με του HuffmanTables γιατί το προηγούμενο είχε spaces τα οποία δυσκόλευαν την αναζήτηση
3) Σε περίπτωση που το runSymbols περιέχει και το Y και το Cb και το Cr τότε τί γίνεται όταν έχουμε πχ δειγματοληψία [4 2 2] ή [4 2 0], όπου τότε τα block των Cb και Cr είναι λιγότερα?
With no chroma subsampling you say that each block needing encoding is represented with the following sequence:
Ydc_Yac_CBdc_CBac_CRdc_CRac
What if we have subsampling? For example with [4 2 0] subsampling, for a 512x512 image we will end up with a
512x512 Y table
256x256 Cb table and
256x256 Cr table
How are we going to create the above sequence since the number of blocks of each table are not equal?
Thanks a lot.
Good question. With chroma subsampling, the luminance components are encoded first (usually 1,2 or 4 blocks) followed by the chrominance components.
So, in your example [4 2 0], we would have:
Y11dc_Y11ac_Y12dc_Y12ac_Y21dc_Y21ac_Y22dc_Y22ac_C Bdc_CBac_CRdc_CRac
... where Y11, Y12, Y21, Y22 represent the luminance of each16x16 block of pixels.