~ubuntu-branches/ubuntu/trusty/libav/trusty-proposed

« back to all changes in this revision

Viewing changes to libavcodec/indeo3.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-10-23 18:49:26 UTC
  • mto: (1.1.18 experimental)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20121023184926-cw5imrodltw6h5o4
Tags: upstream-9~beta2
ImportĀ upstreamĀ versionĀ 9~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
978
978
 *  @param[in]  buf_sel      indicates which frame buffer the input data stored in
979
979
 *  @param[out] dst          pointer to the buffer receiving converted pixels
980
980
 *  @param[in]  dst_pitch    pitch for moving to the next y line
 
981
 *  @param[in]  dst_height   output plane height
981
982
 */
982
 
static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst, int dst_pitch)
 
983
static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst,
 
984
                         int dst_pitch, int dst_height)
983
985
{
984
986
    int             x,y;
985
987
    const uint8_t   *src  = plane->pixels[buf_sel];
986
988
    uint32_t        pitch = plane->pitch;
987
989
 
988
 
    for (y = 0; y < plane->height; y++) {
 
990
    dst_height = FFMIN(dst_height, plane->height);
 
991
    for (y = 0; y < dst_height; y++) {
989
992
        /* convert four pixels at once using SWAR */
990
993
        for (x = 0; x < plane->width >> 2; x++) {
991
994
            AV_WN32A(dst, (AV_RN32A(src) & 0x7F7F7F7F) << 1);
1072
1075
        return res;
1073
1076
    }
1074
1077
 
1075
 
    output_plane(&ctx->planes[0], ctx->buf_sel, ctx->frame.data[0], ctx->frame.linesize[0]);
1076
 
    output_plane(&ctx->planes[1], ctx->buf_sel, ctx->frame.data[1], ctx->frame.linesize[1]);
1077
 
    output_plane(&ctx->planes[2], ctx->buf_sel, ctx->frame.data[2], ctx->frame.linesize[2]);
 
1078
    output_plane(&ctx->planes[0], ctx->buf_sel,
 
1079
                 ctx->frame.data[0], ctx->frame.linesize[0],
 
1080
                 avctx->height);
 
1081
    output_plane(&ctx->planes[1], ctx->buf_sel,
 
1082
                 ctx->frame.data[1], ctx->frame.linesize[1],
 
1083
                 (avctx->height + 3) >> 2);
 
1084
    output_plane(&ctx->planes[2], ctx->buf_sel,
 
1085
                 ctx->frame.data[2], ctx->frame.linesize[2],
 
1086
                 (avctx->height + 3) >> 2);
1078
1087
 
1079
1088
    *data_size      = sizeof(AVFrame);
1080
1089
    *(AVFrame*)data = ctx->frame;
1103
1112
    .init           = decode_init,
1104
1113
    .close          = decode_close,
1105
1114
    .decode         = decode_frame,
 
1115
    .capabilities   = CODEC_CAP_DR1,
1106
1116
    .long_name      = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
1107
1117
};