shshankjain / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

simple_encoder.c doesn't work in ToT #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
According to this page: 
http://www.webmproject.org/tools/vp8-sdk/example_simple_encoder.html.

And do the vpx_image configuration would get an invalid argument error saying 
that codec width / height doesn't match image width / height.

This is caused by the check in vp8_cx_iface.c

static vpx_codec_err_t validate_img(vpx_codec_alg_priv_t *ctx,
                                    const vpx_image_t    *img)
{
    switch (img->fmt)
    {
    case IMG_FMT_YV12:
    case IMG_FMT_I420:
    case IMG_FMT_VPXI420:
    case IMG_FMT_VPXYV12:
        break;
    default:
        ERROR("Invalid image format. Only YV12 and I420 images are supported");
    }

    if ((img->d_w != ctx->cfg.g_w) || (img->d_h != ctx->cfg.g_h))
        ERROR("Image size must match encoder init configuration size");

    return VPX_CODEC_OK;
}

The check is changed to image->d_w instead of image->w. Documentation and 
sample code needs to get updated.

Original issue reported on code.google.com by hc...@google.com on 29 Jul 2010 at 9:41

GoogleCodeExporter commented 9 years ago
Is this related to resolution at all? simple_encoder works for me with a QVGA 
file. Can you provide a example that trips this check?

Original comment by jkoles...@google.com on 29 Jul 2010 at 5:15

GoogleCodeExporter commented 9 years ago
I was trying to write an encoder using libvpx, the reason it was failing for me 
was that I was filling in the vpx_image_t struct manually instead of using 
vpx_alloc_image. Looks like the check implementation has changed since I last 
used it. So this is not a bug and I misinterpreted the sample code.

Please close this bug.

Original comment by hc...@google.com on 30 Jul 2010 at 8:05

GoogleCodeExporter commented 9 years ago

Original comment by jkoles...@google.com on 2 Aug 2010 at 1:30

GoogleCodeExporter commented 9 years ago

Original comment by albe...@google.com on 8 Mar 2012 at 12:10