~ubuntu-branches/ubuntu/oneiric/libav/oneiric

« back to all changes in this revision

Viewing changes to libavcodec/snow.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2011-04-30 14:27:42 UTC
  • mfrom: (1.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110430142742-quvblxk1tj6adlh5
Tags: 4:0.7~b1-1ubuntu1
* Merge from debian. Remaining changes:
  - don't build against libfaad, libdirac, librtmp and libopenjpeg
    (all in universe)
  - explicitly --enable-pic on powerpc, cf. LP #654666
  - different arm configure bits that should probably better be
    merged into debian
* Cherry-picked from git: 
  - install doc/APIChanges and refer to them in NEWS.Debian (Closes: #623682)
  - don't try to install non-existing documentation, fixes FTBFS on powerpc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at>
3
3
 *
4
 
 * This file is part of FFmpeg.
 
4
 * This file is part of Libav.
5
5
 *
6
 
 * FFmpeg is free software; you can redistribute it and/or
 
6
 * Libav is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU Lesser General Public
8
8
 * License as published by the Free Software Foundation; either
9
9
 * version 2.1 of the License, or (at your option) any later version.
10
10
 *
11
 
 * FFmpeg is distributed in the hope that it will be useful,
 
11
 * Libav is distributed in the hope that it will be useful,
12
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
14
 * Lesser General Public License for more details.
15
15
 *
16
16
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with FFmpeg; if not, write to the Free Software
 
17
 * License along with Libav; if not, write to the Free Software
18
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 */
20
20
 
920
920
    }
921
921
}
922
922
 
923
 
static void mc_block(Plane *p, uint8_t *dst, const uint8_t *src, uint8_t *tmp, int stride, int b_w, int b_h, int dx, int dy){
 
923
static void mc_block(Plane *p, uint8_t *dst, const uint8_t *src, int stride, int b_w, int b_h, int dx, int dy){
924
924
    static const uint8_t weight[64]={
925
925
    8,7,6,5,4,3,2,1,
926
926
    7,7,0,0,0,0,0,1,
1106
1106
 
1107
1107
#define mca(dx,dy,b_w)\
1108
1108
static void mc_block_hpel ## dx ## dy ## b_w(uint8_t *dst, const uint8_t *src, int stride, int h){\
1109
 
    uint8_t tmp[stride*(b_w+HTAPS_MAX-1)];\
1110
1109
    assert(h==b_w);\
1111
 
    mc_block(NULL, dst, src-(HTAPS_MAX/2-1)-(HTAPS_MAX/2-1)*stride, tmp, stride, b_w, b_w, dx, dy);\
 
1110
    mc_block(NULL, dst, src-(HTAPS_MAX/2-1)-(HTAPS_MAX/2-1)*stride, stride, b_w, b_w, dx, dy);\
1112
1111
}
1113
1112
 
1114
1113
mca( 0, 0,16)
1172
1171
        src += sx + sy*stride;
1173
1172
        if(   (unsigned)sx >= w - b_w - (HTAPS_MAX-2)
1174
1173
           || (unsigned)sy >= h - b_h - (HTAPS_MAX-2)){
1175
 
            ff_emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h);
 
1174
            s->dsp.emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h);
1176
1175
            src= tmp + MB_SIZE;
1177
1176
        }
1178
1177
//        assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h);
1180
1179
        assert(b_w>1 && b_h>1);
1181
1180
        assert((tab_index>=0 && tab_index<4) || b_w==32);
1182
1181
        if((dx&3) || (dy&3) || !(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h) || (b_w&(b_w-1)) || !s->plane[plane_index].fast_mc )
1183
 
            mc_block(&s->plane[plane_index], dst, src, tmp, stride, b_w, b_h, dx, dy);
 
1182
            mc_block(&s->plane[plane_index], dst, src, stride, b_w, b_h, dx, dy);
1184
1183
        else if(b_w==32){
1185
1184
            int y;
1186
1185
            for(y=0; y<b_h; y+=16){
1977
1976
   int h= s->avctx->height;
1978
1977
 
1979
1978
    if(s->current_picture.data[0]){
1980
 
        s->dsp.draw_edges(s->current_picture.data[0], s->current_picture.linesize[0], w   , h   , EDGE_WIDTH  );
1981
 
        s->dsp.draw_edges(s->current_picture.data[1], s->current_picture.linesize[1], w>>1, h>>1, EDGE_WIDTH/2);
1982
 
        s->dsp.draw_edges(s->current_picture.data[2], s->current_picture.linesize[2], w>>1, h>>1, EDGE_WIDTH/2);
 
1979
        s->dsp.draw_edges(s->current_picture.data[0],
 
1980
                          s->current_picture.linesize[0], w   , h   ,
 
1981
                          EDGE_WIDTH  , EDGE_TOP | EDGE_BOTTOM);
 
1982
        s->dsp.draw_edges(s->current_picture.data[1],
 
1983
                          s->current_picture.linesize[1], w>>1, h>>1,
 
1984
                          EDGE_WIDTH/2, EDGE_TOP | EDGE_BOTTOM);
 
1985
        s->dsp.draw_edges(s->current_picture.data[2],
 
1986
                          s->current_picture.linesize[2], w>>1, h>>1,
 
1987
                          EDGE_WIDTH/2, EDGE_TOP | EDGE_BOTTOM);
1983
1988
    }
1984
1989
 
1985
1990
    release_buffer(s->avctx);
2235
2240
    return 0;
2236
2241
}
2237
2242
 
2238
 
AVCodec snow_decoder = {
 
2243
AVCodec ff_snow_decoder = {
2239
2244
    "snow",
2240
2245
    AVMEDIA_TYPE_VIDEO,
2241
2246
    CODEC_ID_SNOW,
3986
3991
    return 0;
3987
3992
}
3988
3993
 
3989
 
AVCodec snow_encoder = {
 
3994
AVCodec ff_snow_encoder = {
3990
3995
    "snow",
3991
3996
    AVMEDIA_TYPE_VIDEO,
3992
3997
    CODEC_ID_SNOW,