newbie question on vpx_image_t

148 views
Skip to first unread message

Pawel Veselov

unread,
Nov 25, 2013, 2:22:33 AM11/25/13
to apps-...@webmproject.org
Hi.

If somebody could please clarify these about the vpx_image_t data, I'd really appreciate it.
This is as pertaining to libvpx-1.2.0

What really happens when h/w is different from d_h/d_w?

bps is ignored, since the only acceptable formats are planar, and not packed, isn't it?

What are X and Y sub-sampling order values?

4th (alpha) plane is never used, right (supported formats have no alpha channel)?

What's the difference between I420/YV12 and VPXI420/VPXYV12? 

Thank you,
   Pawel.

Johann Koenig

unread,
Nov 25, 2013, 2:56:39 PM11/25/13
to Application Developers
On Sun, Nov 24, 2013 at 11:22 PM, Pawel Veselov <pawel....@gmail.com> wrote:
> If somebody could please clarify these about the vpx_image_t data, I'd
> really appreciate it.
> This is as pertaining to libvpx-1.2.0

I presume you are using VP8

> What really happens when h/w is different from d_h/d_w?

The buffer is aligned. If the display dimensions are not multiples of
16 or there is a border (used internally), then they will not match.
When you copy the image after decoding, you want to copy the display
size.

> bps is ignored, since the only acceptable formats are planar, and not
> packed, isn't it?

Yes, VP8 supports only planar

> What are X and Y sub-sampling order values?
>
> 4th (alpha) plane is never used, right (supported formats have no alpha
> channel)?

There is no alpha support in VP8, but it has been added outside the codec:
http://updates.html5rocks.com/2013/07/Alpha-transparency-in-Chrome-video

> What's the difference between I420/YV12 and VPXI420/VPXYV12?

There should be no difference between I420 and VPXI420

The difference between I420 and YV12 that I420 has Y, U, V and YV12 has Y, V, U

Pawel Veselov

unread,
Nov 25, 2013, 3:20:51 PM11/25/13
to apps-...@webmproject.org
Hi Johann,

thank you for clarifying those. Some follow-up though.

On Mon, Nov 25, 2013 at 11:56 AM, Johann Koenig <johann...@google.com> wrote:
On Sun, Nov 24, 2013 at 11:22 PM, Pawel Veselov <pawel....@gmail.com> wrote:
> If somebody could please clarify these about the vpx_image_t data, I'd
> really appreciate it.
> This is as pertaining to libvpx-1.2.0
I presume you are using VP8

Yes. And out of the box, libvpx-1.2.0 (published by WebM) doesn't have any other codecs, right?
 
> bps is ignored, since the only acceptable formats are planar, and not
> packed, isn't it?
Yes, VP8 supports only planar

So, 'bps' field is ignored then, right?
 
> What are X and Y sub-sampling order values?

Could you please clarify those? So far my guess is that it has something to do with how chroma information is applied to, or was taken from, the 8 pixels from the corresponding sampling region.

> What's the difference between I420/YV12 and VPXI420/VPXYV12?
There should be no difference between I420 and VPXI420
The difference between I420 and YV12 that I420 has Y, U, V and YV12 has Y, V, U

So, I420 is same as VPXI420, and YV12 is same as VPXYV12. I guess application should only use I420 and YV12 format types, as "VPX*" is internal to libvpx?


Thank you,
  Pawel.

Johann Koenig

unread,
Nov 25, 2013, 5:43:04 PM11/25/13
to Application Developers
On Mon, Nov 25, 2013 at 12:20 PM, Pawel Veselov <pawel....@gmail.com> wrote:
> On Mon, Nov 25, 2013 at 11:56 AM, Johann Koenig <johann...@google.com>
> wrote:
>> On Sun, Nov 24, 2013 at 11:22 PM, Pawel Veselov <pawel....@gmail.com>
>> wrote:
>> > This is as pertaining to libvpx-1.2.0
>> I presume you are using VP8
>
> Yes. And out of the box, libvpx-1.2.0 (published by WebM) doesn't have any
> other codecs, right?

That is correct.

>> > bps is ignored, since the only acceptable formats are planar, and not
>> > packed, isn't it?
>> Yes, VP8 supports only planar
>
> So, 'bps' field is ignored then, right?

It is always set to 12 because libvpx only supports I420.

>> > What are X and Y sub-sampling order values?
>
> Could you please clarify those? So far my guess is that it has something to
> do with how chroma information is applied to, or was taken from, the 8
> pixels from the corresponding sampling region.

I'm not sure.

>> > What's the difference between I420/YV12 and VPXI420/VPXYV12?
>> There should be no difference between I420 and VPXI420
>> The difference between I420 and YV12 that I420 has Y, U, V and YV12 has Y,
>> V, U
>
> So, I420 is same as VPXI420, and YV12 is same as VPXYV12. I guess
> application should only use I420 and YV12 format types, as "VPX*" is
> internal to libvpx?

The part of the application which calls libvpx functions must use
vpx_img_fmt_t so that the enum values match.

John Koleszar

unread,
Nov 26, 2013, 12:08:51 PM11/26/13
to Application Developers
The VPXI420 and VPXYV12 variants were for a non-bt601 colorspace that
was libvpx specific (and possibly not even connected, I don't recall)
which was faster to convert to/from RGB. Don't use them, you want the
other ones.

Pawel S. Veselov

unread,
Dec 14, 2013, 12:52:52 PM12/14/13
to apps-...@webmproject.org
On 11/24/2013 11:22 PM, Pawel Veselov wrote:
What are X and Y sub-sampling order values?

Reply all
Reply to author
Forward
0 new messages