[Mp4-tech] Question regarding yuv file

sagar sagar sarayusoftech.com
Wed Aug 9 10:46:51 EDT 2006


Hi all,
I have a single yuv frame of CIF ( 4:2:0).
Not i wanted to know how the compnents Y, Cb, & Cr are arranged?
And if i needed only grey or Y component how do i do that?
I tried Y = Height * Width .
But surprisingly i still get colour. I want to elimanate Cb and Cr component
and
obtain a grey frame only.
Can somebody help me with this?
Thank you in adavance.
Warm Regards,
Sagar
-----Original Message-----
From: mp4-tech-bounces lists.mpegif.org
[mailto:mp4-tech-bounces lists.mpegif.org]On Behalf Of JK Kim
Sent: Monday, August 07, 2023 8:12 AM
To: 'Tan Rui -- Huawei'; mp4-tech lists.mpegif.org
Subject: RE: [Mp4-tech] [H.264] A question about the mbAddrCol
calculation
Sorry for the former reply, which was sent by mistake :-).
As you know, all are coming from the fact
that a reference and a current have different geometric scale.
Current 1 MB is mapped to Reference 2 MB.
So, upper 8 rows are mapped to upper MB in reference,
and lower 8 rows are mapped to lower MB in reference.
That is,
(yCol/8) is used for getting corresponding MB, mbAddrCol,
and (yCol%8) is used for getting position, yM.
Reference				Current
|--------|	=	=	=   =>	|--------|
|        |				|        |
|        |			*   *>	|        |
|        |		*		|        |
|--------|	*		    #>	|--------|
|        |
|        |			#
|        |		#
|--------|	#

Upper mb_num					MbX = CurrMbAddr %
PicWidthInMbs
= PicWidthInMbs*2*MbY + MbX		MbY = CurrMbAddr / PicWidthInMbs
Lower mb_num
= PicWidthInMbs*(2*MbY+1) + MbX
 ("Lower" means yCol>=8)
= PicWidthInMbs*(2*MbY+yCol/8)+MbX
yM (scale is twice, so two times)		yCol
= 2*yCol - (y of corresponding MB)
= (2*yCol) % 16
I wish this will help you.
	Regards,
	JK
________________________________________
From: mp4-tech-bounces lists.mpegif.org
[mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of Tan Rui -- Huawei
Sent: Friday, August 04, 2023 7:25 PM
To: mp4-tech lists.mpegif.org
Subject: [Mp4-tech] [H.264] A question about the mbAddrCol calculation
Hi, All experts,
 
When I read the section 8.4.1.2.1 in the H.264 protocol, I find that the
calculation about the mbAddrCol is very difficult to understand.
For example, the mbAddrCol1 is calculated as the following:
 
mbAddrCol1 = 2 * PicWidthInMbs * (CurrMbAddr/PicWidthInMbs) + (CurrMbAddr %
PicWidthInMbs) + PicWidthInMbs * (yCol / 8)
 
I know the above calculation will occur at the Frm-to-Fld condition. I think
the first item [ 2 * PicWidthInMbs * (CurrMbAddr/PicWidthInMbs) ]
will get the co-located row number in the co-located frame and the second
item [ (CurrMbAddr % PicWidthInMbs) ] will get the column
number. But how about the third item? Why yCol need divide by 8 ? I can not
figure it out. Can some one make it clear to me? Thanks.
 
Tan Rui
2023/08/04
 
_______________________________________________
NOTE: Please use clear subject lines for your posts. Include [audio,
[video], [systems], [general] or another apppropriate identifier to indicate
the type of question you have.
Note: Conduct on the mailing list is subject to the Antitrust guidelines
found at
http://www.mpegif.org/public/documents/vault/mp-out-30042-Antitrust.php
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


More information about the Mp4-tech mailing list