RE: Questions regarding your's decoding process????????????????

Christoph Lampert <[email protected]>
Newsgroups gmane.comp.video.xvid.user
Message-ID <[email protected]>
Hi,

On Fri, 10 Jan 2003, Amit Bhushan wrote:
> Hello,
> 
>           Thanks for the reply but what i wanted to ask is, will be
> clear by seeing the output of the encoder's output. 1.> The encoder
> only takes intra frames even if i give it 12 frames here's the output
> of encoder.
>
> Encoder o/p (Taking all as intra frames)

No, it doesn't. _Please_ read the source code before asking such stuff.

> 
> Frame     0: intra 1, enctime=  15.0 ms, size=  4171bytes
> Frame     1: intra 0, enctime= 125.0 ms, size=  1073bytes
               ^^^^^^^

This is the output of the internal "intra" variable. It is 
intra==1 if the frame IS intra, and  intra==0 if the frame IS NOT intra. 

Okay? 

> Decoder o/p (Frame skiping)
> 
> Frame     0: dectime =  16.0 ms length=   4166 bytes
> Frame     1: dectime =  16.0 ms length=   1069 bytes
> Frame     2: dectime =   0.0 ms length=   1181 bytes (Frame skiping)
> Frame     3: dectime =  15.0 ms length=   1624 bytes
> Frame     4: dectime =   0.0 ms length=   1157 bytes (Frame skiping)
> Frame     5: dectime =  16.0 ms length=   1176 bytes
> Frame     6: dectime =   0.0 ms length=   1595 bytes (Frame skiping)
> Frame     7: dectime =  15.0 ms length=   1146 bytes
> Frame     8: dectime =   0.0 ms length=   1161 bytes (Frame skiping)
> Frame     9: dectime =  16.0 ms length=   1615 bytes
> Frame    10: dectime =   0.0 ms length=   1141 bytes (Frame skiping)
> Frame    11: dectime =  16.0 ms length=   1172 bytes
> Avg: dectime  9.17 ms, 109.09 fps, mp4 stream size =1516
> 
> Why is this happening????? 

Maybe you are encoding with B-frames enabled but decoding with a version
of XVID that does not support B-frames? Then the B-frames are skipped. 
Or you enabled frame-skip in the encoder, which you shouldn't. 
Otherwise, I don't know. 


> 2.> in decoder.c in decoder_create function
>    it is given that
>  mb_width=(dec->width+15)/16
>  mb_height=(dec->height+15)/16. why they are adding 15 and divding by
> 16.why is the above calculation done if it's always going to be 11 or
> 9 (depending on type) if you are using abs() values.


We divide by 16, because that's the size of 1 macroblock. If we divide the
width of the image by 16, we get the number of macroblocks. But since we
always have to round the value "width/16" UP to the next integer, we use
(width+15)/16 which is the same as "width/16 always rounded up". 

mb_width==11 for QCIF, but not of other sizes, of course, as you can
easily see from the formula. For CIF it's 22. For 720x576 full PAL it's 
45. 


> 3.> what is the variable stride ,src_stride, y_stride and uv_stride
> used for. Can you please explain in details about it???

If the first pixel of the first line of an image is a the address 0x10000
and stride==0x00123, then the first pixel of the second line of the image
is at 0x10123, and the first pixel of the third line of the image is at 
0x10246, and the first pixel of the third line of the image is at 
0x10369, etc. etc. etc. etc. 

src_stride is the stride value for the "source" of something.
y_stride is the stride value for the Y component of some YUV image. 
uv_stride is the stride value for the U and the V component of some
YUV image.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.