Log in

View Full Version : H.26L impressions


Pages : 1 [2]

Nic
9th September 2002, 22:52
Hmmm, Id give out my version of the JM with the AVI load code now....but ive been put in a bad mood today :( grrrr

I was quite impressed with low bitrate, but not so much at higher bitrates (but maybe I muddled some settings)...

Ive been playing around with that 4x4 transform, I know im being stupid but does anyone have a better idea than myself of how to apply it horizontally & vertically on the 4x4 block (im sure I must be doing it wrong...)

Cheers,
-Nic

SirDavidGuy
10th September 2002, 02:02
Ive been playing around with that 4x4 transform, I know im being stupid but does anyone have a better idea than myself of how to apply it horizontally & vertically on the 4x4 block (im sure I must be doing it wrong...)

In block.c:

void itrans(
struct img_par *img, /*!< image parameters */
int ioff, /*!< index to 4x4 block */
int joff, /*!< */
int i0, /*!< */
int j0) /*!< */
{
int i,j,i1,j1;
int m5[4];
int m6[4];

/* horisontal */
for (j=0;j<BLOCK_SIZE;j++)
{
for (i=0;i<BLOCK_SIZE;i++)
{
m5[i]=img->cof[i0][j0][i][j];
}
m6[0]=(m5[0]+m5[2])*13;
m6[1]=(m5[0]-m5[2])*13;
m6[2]=m5[1]*7-m5[3]*17;
m6[3]=m5[1]*17+m5[3]*7;

for (i=0;i<2;i++)
{
i1=3-i;
img->m7[i][j]=m6[i]+m6[i1];
img->m7[i1][j]=m6[i]-m6[i1];
}
}
/* vertical */
for (i=0;i<BLOCK_SIZE;i++)
{
for (j=0;j<BLOCK_SIZE;j++)
m5[j]=img->m7[i][j];

m6[0]=(m5[0]+m5[2])*13;
m6[1]=(m5[0]-m5[2])*13;
m6[2]=m5[1]*7-m5[3]*17;
m6[3]=m5[1]*17+m5[3]*7;

for (j=0;j<2;j++)
{
j1=3-j;
img->m7[i][j]=mmax(0,mmin(255,(m6[j]+m6[j1]+img->mpr[i+ioff][j+joff]*JQQ+JQQ2)/JQQ));
img->m7[i][j1]=mmax(0,mmin(255,(m6[j]-m6[j1]+img->mpr[i+ioff][j1+joff]*JQQ+JQQ2)/JQQ));
}
}

}


/*!
* \fn itrans_2()
* \brief invers transform
*/
void itrans_2(
struct img_par *img) /*!< image parameters */
{
int i,j,i1,j1;
int M5[4];
int M6[4];

/* horizontal */
for (j=0;j<4;j++)
{
for (i=0;i<4;i++)
M5[i]=img->cof[i][j][0][0];

M6[0]=(M5[0]+M5[2])*13;
M6[1]=(M5[0]-M5[2])*13;
M6[2]= M5[1]*7 -M5[3]*17;
M6[3]= M5[1]*17+M5[3]*7;

for (i=0;i<2;i++)
{
i1=3-i;
img->cof[i ][j][0][0]= M6[i]+M6[i1];
img->cof[i1][j][0][0]=M6[i]-M6[i1];
}
}

/* vertical */
for (i=0;i<4;i++)
{
for (j=0;j<4;j++)
M5[j]=img->cof[i][j][0][0];

M6[0]=(M5[0]+M5[2])*13;
M6[1]=(M5[0]-M5[2])*13;
M6[2]= M5[1]*7 -M5[3]*17;
M6[3]= M5[1]*17+M5[3]*7;

for (j=0;j<2;j++)
{
j1=3-j;
img->cof[i][j][0][0] = ((M6[j]+M6[j1])/8) *JQ1[img->qp];
img->cof[i][j1][0][0]= ((M6[j]-M6[j1])/8) *JQ1[img->qp];
}
}
for (j=0;j<4;j++)
{
for (i=0;i<4;i++)
{
img->cof[i][j][0][0] = 3 * img->cof[i][j][0][0]/256;
}
}
}


This is code for the Inverse Transform, but you get the idea.

On an unrelated note, I've figured out what it uses the Hardamard tansform for; Motion Estimation! Apparently it chooses it over SAD. An interesting idea, to say the least...

Nic
10th September 2002, 09:17
Cheers Davey, sorry for being lazy :) I should have looked it up in the source.

Take Care,
-Nic

Vanos_b
10th September 2002, 12:18
I've noticed a very annoing thing: the encoder doesn't stop until I press Ctrl+Brake; if I have a 100 frames clip and I set FramesToBeEncoded 100 (but it's the same with 50) the encoder continues to work on the clip compressing full-pink images even after the 100th frame (no 99); I've tried to set it to 99 (maybe the last frame can't be a B-frame - I always use B-frames) but it's the same. Anybody had this problem too?
@Nic: JM avi load version? This sounds very interesting. If you'll be in a better mood PLEASE post it (the binaries and/or source, not that your in a better mood :) ).
Edit: You're right, it's not so impressive on high bitrate clips, but maybe it's because the differences are less obvious or because it needs optimisations, but for low to middle bitrate is very good, and I would really like to see a 1 CD rip.

Regards

Tommy Carrot
10th September 2002, 23:18
Originally posted by Vanos_b
I've noticed a very annoing thing: the encoder doesn't stop until I press Ctrl+Brake; if I have a 100 frames clip and I set FramesToBeEncoded 100 (but it's the same with 50) the encoder continues to work on the clip compressing full-pink images even after the 100th frame (no 99); I've tried to set it to 99 (maybe the last frame can't be a B-frame - I always use B-frames) but it's the same. Anybody had this problem too?


You have to set LastFrameNumber to the same as FramesToBeEncoded.

Tommy Carrot
11th September 2002, 00:02
I'm just curious: Is it theoretically possible to create an AVI codec from this stuff? Is the AVI format capable to use all the advanced features (multiple reference frames, etc)?

I guess several part could be taken from xvid, but still, the speed should be at least 100 times faster to be really usable, and i do not think it is possible (yes, i've changed my mind :))

SirDavidGuy
11th September 2002, 00:10
I think it's possible to fit it into AVI, using one of the packing schemes.

eg. when the frame order goes: IPBIIPBBPI , you would send all the I-Frames in the GOP, then the P-Frames, then the B-Frames, but you would have to introduce an audio delay somewhere. The decoder would also have to keep careful track of which frame is being displayed, but it should (I Think) be possible.

Vanos_b
11th September 2002, 08:47
Thanx for the tip Tommy, I haven't even seen it - silly me :o .
About putting it in an .avi file, it should be possible at least with 1 B-frame (DivX 5 does it).

Regards

Tommy Carrot
12th September 2002, 23:17
Anyone knows why it has 2 kind of entropy coder(cavlc and cabac)? CABAC was better on all of my tests. In some whitepaper they claims CAVLC (UVLC) is better at higher bitrates, but in my experience it was never better.

I did a 10 min (15000 frames) long test on Matrix with the fastest settings i wrote above. One problem: the yuv file filled all of my HDD. The encoding took about 3 hours. :) I used quantizer 24, no bframes and i got about 420 kbit (yes, too low, but would rather not begin a new test, too much time). The quality was better at the largest part than my xvid with constant 4 mpeg quantizer (680 kbit). Only at very high motion was the xvid better.

Conclusion: even with all the extra features switched off, the quality is far superior for the purpose of 1CD movies (for 2CD, the xvid is good enough, but i hate swapping the cds at the middle of the movie:)) And with these setting, it's only 40 times slower than current codecs :) (but still a 15X increase to the default config) :eek:

Anyway, i could imagine this for 1cd purposes. :)

Rrrough
13th September 2002, 10:20
Cheers Nic, I know you're a digital workaholic and are involved in countless projects, but may I ask if there's any progress on your version of the JM with the AVI load code ??? Hope your mood is a lot better now...

take care

FastMike
9th June 2003, 22:28
Nic,

Is there anywhere I can obtain a copy of your AVItoYUV util? I cannot find anything else that does what I need. Nor do I have the technical know-how to write my own.


Originally posted by Nic
Yeah I wrote my own YUVViewer & AVItoYUV to play with it...I even speeded it up a little (I started at 2.1 last time I was on 3.9(

Its very good at low bitarte, doesnt macroblock in the same way, kinda just distorts slightly, alot better to the eye...

everso slow though :)

Cheers,
-Nic

*.mp4 guy
24th May 2004, 03:28
im rather new to posting, however i have tested the ffdshow vfw encoder's h.264 implementation and found it much easier to test the quality of h.264 vs mp4 with.

btw: it is a suspision of mine that spb deblocking may be related to h.264 deblocking.

i hope im in context :D

avih
24th May 2004, 09:24
Originally posted by *.mp4 guy
im rather new to posting, however i have tested the ffdshow vfw encoder's h.264 implementation and found it much easier to test the quality of h.264 vs mp4 with.

btw: it is a suspision of mine that spb deblocking may be related to h.264 deblocking.

i hope im in context :D

Hi, and welcome to the forum.

No offence ment, but the post you replied to is nearly 1 year old ;) it's sometimes usefull to have a loot at the post's date ;)

cheers mate. and enjoy your staying here.
avih

bond
24th May 2004, 09:29
and plz become familiar with a correct naming sheme to avoid confusion :)

h.264 = mpeg-4 part 10 (or mpeg-4 avc)
xvid, divx5 aso = mpeg-4 part 2 (or mpeg-4 asp)
mp4 = .mp4 container (can carry both avc and asp)

oddball
24th May 2004, 23:19
what's the latest info on this codec? :)

unmei
25th May 2004, 11:39
h.264 is broadly discussed in the new A/V - codecs forum
Mpeg-4 FAQ (http://forum.doom9.org/showthread.php?threadid=73022)
status & definition thread (http://forum.doom9.org/showthread.php?threadid=71396)
Sagittaires codecs test (http://forum.doom9.org/showthread.php?threadid=64789)
Nero digital h.264 (http://forum.doom9.org/showthread.php?threadid=72857)
VSS (http://forum.doom9.org/showthread.php?threadid=74047)
frame types (http://forum.doom9.org/showthread.php?threadid=75866)
encoder (http://forum.doom9.org/showthread.php?threadid=65692)

Wilbert
25th May 2004, 13:14
Thread closed, because it is outdated.

Please, continue in one of those threads mentioned by unmei (or a new one) in the appropriate forum.