PDA

View Full Version : how to create avc lossless streams with the avc reference encoder?


bond
1st June 2005, 22:35
i tried to create avc lossless streams with the reference encoder, but i couldnt get it to work

it seems that only enabling the lossless mode in the .cfg isnt enough. i assume some other options incompliant with the lossless mode have to be disable too, any idea which ones?

akupenguin
2nd June 2005, 00:42
Did you also set QP=0? H.264 allows some frames / MBs to be lossless while others are encoded normally.

CyberGuy
2nd June 2005, 00:47
i tried to create avc lossless streams with the reference encoder, but i couldnt get it to work

it seems that only enabling the lossless mode in the .cfg isnt enough. i assume some other options incompliant with the lossless mode have to be disable too, any idea which ones?
I may be showing my ignorance here, but from what I have read, setting the QP values to 0 as well as setting QPPrimeYZeroTransformBypassFlag to 1 should give you lossless encoding, but I have not tried this. I don't believe that you have to disable any other settings . Hopefully someone else will confirm or deny this.

bond
2nd June 2005, 23:24
ok setting QPPrimeYZeroTransformBypassFlag to 1 and all quants to 0 does it

the only problem is that the encoder has a problem with b-frames at the end (propably if the last frame has to be written as b-frame, but obviously cant be written as the future reference isnt there!?)


btw the reference decoder is damn fast on lossless streams

SeeMoreDigital
2nd June 2005, 23:56
Is it possible to generate AVC lossless streams without b-frames?


Cheers

bond
2nd June 2005, 23:59
Is it possible to generate AVC lossless streams without b-frames?
sure, the filesize will be just a little bit bigger than with b-frames :)

btw the nero decoder can decode lossless streams too

SeeMoreDigital
3rd June 2005, 00:37
Sounds very nice...

Can you offer any approximations on bit-rate settings for 720x576 encodes?


Cheers

bill_baroud
3rd June 2005, 09:26
btw the reference decoder is damn fast on lossless streams

and the encoder ? (that what's matter generally for a lossless codec ;))

bond
3rd June 2005, 11:41
Can you offer any approximations on bit-rate settings for 720x576 encodes?
you mean how good it compresses?

it seems to get the bitrate down to one third compared to the raw yuv here

and the encoder ? (that what's matter generally for a lossless codec ;))
i thought the compression ratio matters the most :D
well the reference surely doesnt encode in realtime if thats what you care about

SeeMoreDigital
3rd June 2005, 12:25
you mean how good it compresses?

it seems to get the bitrate down to one third compared to the raw yuv hereCan you remind me of the compression ratio of RAW YUV streams please?


Cheers

Tommy Carrot
3rd June 2005, 12:41
raw yuv is uncompressed.

SeeMoreDigital
3rd June 2005, 13:30
raw yuv is uncompressed.Yes I know that... but it must run an approx/average bit-rate!

DV.avi (which ofcourse is compressed) runs at around 225MB per minute.


Cheers

stephanV
3rd June 2005, 13:54
uhm... how about grabbing a calculator:


YV12 is 6 bytes for 2x2 pixels or 1.5 byte for 1 pixel

720*576*1.5 = 622080 bytes / frame

622080 * 25 fps = 14.8 MB/s or 890 MB / min.


on a 1:3 ratio this would give approx. 297MB/min for lossless AVC at 720x576 at 25 fps

BTW - if the decoding complexity of lossless AVC is the same as lossy AVC than a 1:3 ratio is not praticulary good for lossless...

bond
19th June 2005, 00:48
ok i now found out that you have to do three things in order to be able to encode losslessly with the reference:
1) set all quants (i/p/b-frames) to 0
2) set the lossless flag to 1
3) set the profile to 144

when doing 1+2 but not 3 you dont seem to get a real lossless stream (even if the filesize and the decoded raw yuv stream would indicate it maybe)



btw i saw that using cqm doesnt seem to influence the filesize, does it get ignored like loop maybe with lossless?

akupenguin
19th June 2005, 01:23
btw i saw that using cqm doesnt seem to influence the filesize, does it get ignored like loop maybe with lossless? Of course it ignores the quantizer matrix - if it quantized, it wouldn't be lossless.

Elias
19th June 2005, 02:29
Is lossless AVC actually lossless, or visually lossless? How much space storage does it take in comparison with Huffyuv?

berrinam
19th June 2005, 02:58
It is mathematically lossless, which means it can reproduce a bit-exact copy. Tommy Carrot did a comparison here (http://forum.doom9.org/showthread.php?p=673899#post673899), but it doesn't have anything about the JM reference encoder.

Tommy Carrot
19th June 2005, 16:19
Some times ago someone made modified JM encoders which was able to open .avs files. If something like that exists from JM 9.6 too, i can give it a try.

Elias
19th June 2005, 16:23
It is mathematically lossless, which means it can reproduce a bit-exact copy. Tommy Carrot did a comparison here (http://forum.doom9.org/showthread.php?p=673899#post673899), but it doesn't have anything about the JM reference encoder.So in other words, it's exactly as lossless as Huffyuv? Is it MPEG-4 compliant (like, covered by the MPEG-4 ISO/IEC standard)? I haven't heard anything about lossless MPEG-4 video.

akupenguin
19th June 2005, 21:53
So in other words, it's exactly as lossless as Huffyuv?Yes.
Is it MPEG-4 compliant (like, covered by the MPEG-4 ISO/IEC standard)? I haven't heard anything about lossless MPEG-4 video. It's covered by H.264 high profile, which was published in 2005 march.

SeeMoreDigital
19th June 2005, 23:08
Lossless video for the .MP4 container.... It's a dream come true :D


Cheers

Elias
19th June 2005, 23:38
Lossless video for the .MP4 container.... It's a dream come true :D


CheersIndeed. Now this I like. Now all we need is for MPEG to finish their lossless MPEG-4 audio so we can use that in the *.mp4 container in conjunction with MPEG-4 lossless AVC :)