|
List Info
Thread: libmpeg2 IDCT implementation
|
|
| libmpeg2 IDCT implementation |

|
2007-11-30 12:54:17 |
|
Hi, I see in pratice and in emails of the past ([mpeg2-dev] Re: mpeg2-dev Scan order - 2004-02-19, and Re: [mpeg2-dev] about the idct! - 2004-04-30) that the IDCT of two dimensions performed by idct_row and idct_col operating
together (how we can see in mpeg2_idct_copy_c and mpeg2_idct_copy_add), in libmpeg2 are different of a "default" IDCT (DCT type-3). But in a experiment that I have to do, I would like to use the "default" IDCT. So I need
by pass the modifications done in a block before do the IDCT or apply a function that remove this modifications. But I don't know what modifications exist, strictly speaking. I see that mpeg2_idct_init changes the order of
mpeg2_scan_norm and mpeg2_scan_alt, and functions that "reconstructs" the block, like get_intra_block_B14 use this vectors. So I can see a reordering of block in here. Where are and who are the others modifications?
Another question, the values of block parameter in mpeg2_idct_copy_c and mpeg2_idct_add_c functions, after the loop that do the IDCT: " for (i = 0; i < 8; i++) idct_row (block + 8 * i); for (i = 0; i < 8; i++)
idct_col (block + i); " are the same if I use a "default" IDCT, right? Because the IDCTs "at the end" must be the same, right?
Thanks!
Mateus Krepsky Ludwich.
|
| Re: libmpeg2 IDCT implementation |

|
2008-01-17 10:50:21 |
|
Hello, I finally discovered the answer to my previous question:
"what modifications libmpeg2 does in a block before it enter in the IDCT functions?"
So, the 64 values of a block are multiplied by 16 and reordered. And the IDCT
functions of libmpeg2 know this and its output are the same of a "default" IDCT (DCT type-3), of course. I would like to thank Dmitriy Startsev that tell me about the scaled by 16. And the reordering I discovered by myself. And only
after this I saw a email of Matthew Fullerton that answering a question of Uros damnjanovic (Re: [mpeg2-dev] Extracting DCT coefficients for each frame - coefficient order) and brought the inverse reorder that I was looking for... ;p
Below are the mapping to reorder libmpeg2 IDCT input to the "default" IDCT input, and the inverse reorder mapping ("default" IDCT input to libmpeg2 IDCT input).
Libmpeg2 IDCT input --> "Default" IDCT input / "Default" IDCT input --> Libmpeg2 IDCT input
0 --> 0 / 0 --> 0 1 --> 2 / 1 --> 4 2 --> 4 / 2 --> 1 3 --> 6 / 3 --> 5 4 --> 1 / 4 --> 2
5 --> 3 / 5 --> 6 6 --> 5 / 6 --> 3 7 --> 7 / 7 --> 7 8 --> 16 / 8 --> 32 9 --> 18 / 9 --> 36
10 --> 20 / 10 --> 33 11 --> 22 / 11 --> 37 12 --> 17 / 12 --> 34 13 --> 19 / 13 --> 38 14 --> 21 / 14 --> 35
15 --> 23 / 15 --> 39 16 --> 32 / 16 --> 8 17 --> 34 / 17 --> 12 18 --> 36 / 18 --> 9 19 --> 38 / 19 --> 13
20 --> 33 / 20 --> 10 21 --> 35 / 21 --> 14 22 --> 37 / 22 --> 11 23 --> 39 / 23 --> 15 24 --> 48 / 24 --> 40
25 --> 50 / 25 --> 44 26 --> 52 / 26 --> 41 27 --> 54 / 27 --> 45 28 --> 49 / 28 --> 42 29 --> 51 / 29 --> 46
30 --> 53 / 30 --> 43 31 --> 55 / 31 --> 47 32 --> 8 / 32 --> 16 33 --> 10 / 33 --> 20 34 --> 12 / 34 --> 17
35 --> 14 / 35 --> 21 36 --> 9 / 36 --> 18 37 --> 11 / 37 --> 22 38 --> 13 / 38 --> 19 39 --> 15 / 39 --> 23
40 --> 24 / 40 --> 48 41 --> 26 / 41 --> 52 42 --> 28 / 42 --> 49 43 --> 30 / 43 --> 53 44 --> 25 / 44 --> 50
45 --> 27 / 45 --> 54 46 --> 29 / 46 --> 51 47 --> 31 / 47 --> 55 48 --> 40 / 48 --> 24 49 --> 42 / 49 --> 28
50 --> 44 / &nbs | |