~ubuntu-branches/ubuntu/utopic/libav/utopic-proposed

« back to all changes in this revision

Viewing changes to libavcodec/h264pred.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler, Reinhard Tartler, Rico Tzschichholz
  • Date: 2014-08-30 11:02:45 UTC
  • mfrom: (1.3.47 sid)
  • Revision ID: package-import@ubuntu.com-20140830110245-io3dg7q85wfr7125
Tags: 6:11~beta1-2
[ Reinhard Tartler ]
* Make libavcodec-dev depend on libavresample-dev

[ Rico Tzschichholz ]
* Some fixes and leftovers from soname bumps

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 */
27
27
 
28
28
#include "libavutil/attributes.h"
29
 
#include "dsputil.h"
 
29
#include "libavutil/intreadwrite.h"
 
30
#include "avcodec.h"
30
31
#include "h264pred.h"
31
32
 
32
33
#define BIT_DEPTH 8
269
270
static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright,
270
271
                             ptrdiff_t stride)
271
272
{
272
 
    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
 
273
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP - src[-1-stride];
273
274
    uint8_t *top = src-stride;
274
275
    int y;
275
276
 
295
296
 
296
297
static void pred16x16_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
297
298
{
298
 
    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
 
299
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP - src[-1-stride];
299
300
    uint8_t *top = src-stride;
300
301
    int y;
301
302
 
377
378
 
378
379
static void pred8x8_tm_vp8_c(uint8_t *src, ptrdiff_t stride)
379
380
{
380
 
    const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP - src[-1-stride];
 
381
    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP - src[-1-stride];
381
382
    uint8_t *top = src-stride;
382
383
    int y;
383
384
 
410
411
 
411
412
#define H264_PRED(depth) \
412
413
    if(codec_id != AV_CODEC_ID_RV40){\
413
 
        if(codec_id == AV_CODEC_ID_VP8) {\
 
414
        if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
414
415
            h->pred4x4[VERT_PRED       ]= FUNCD(pred4x4_vertical_vp8);\
415
416
            h->pred4x4[HOR_PRED        ]= FUNCD(pred4x4_horizontal_vp8);\
416
417
        } else {\
425
426
        h->pred4x4[DIAG_DOWN_RIGHT_PRED]= FUNCC(pred4x4_down_right        , depth);\
426
427
        h->pred4x4[VERT_RIGHT_PRED     ]= FUNCC(pred4x4_vertical_right    , depth);\
427
428
        h->pred4x4[HOR_DOWN_PRED       ]= FUNCC(pred4x4_horizontal_down   , depth);\
428
 
        if (codec_id == AV_CODEC_ID_VP8) {\
 
429
        if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
429
430
            h->pred4x4[VERT_LEFT_PRED  ]= FUNCD(pred4x4_vertical_left_vp8);\
430
431
        } else\
431
432
            h->pred4x4[VERT_LEFT_PRED  ]= FUNCC(pred4x4_vertical_left     , depth);\
432
433
        h->pred4x4[HOR_UP_PRED         ]= FUNCC(pred4x4_horizontal_up     , depth);\
433
 
        if(codec_id != AV_CODEC_ID_VP8) {\
 
434
        if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {\
434
435
            h->pred4x4[LEFT_DC_PRED    ]= FUNCC(pred4x4_left_dc           , depth);\
435
436
            h->pred4x4[TOP_DC_PRED     ]= FUNCC(pred4x4_top_dc            , depth);\
436
 
            h->pred4x4[DC_128_PRED     ]= FUNCC(pred4x4_128_dc            , depth);\
437
437
        } else {\
438
438
            h->pred4x4[TM_VP8_PRED     ]= FUNCD(pred4x4_tm_vp8);\
439
439
            h->pred4x4[DC_127_PRED     ]= FUNCC(pred4x4_127_dc            , depth);\
441
441
            h->pred4x4[VERT_VP8_PRED   ]= FUNCC(pred4x4_vertical          , depth);\
442
442
            h->pred4x4[HOR_VP8_PRED    ]= FUNCC(pred4x4_horizontal        , depth);\
443
443
        }\
 
444
        if (codec_id != AV_CODEC_ID_VP8)\
 
445
            h->pred4x4[DC_128_PRED     ]= FUNCC(pred4x4_128_dc            , depth);\
444
446
    }else{\
445
447
        h->pred4x4[VERT_PRED           ]= FUNCC(pred4x4_vertical          , depth);\
446
448
        h->pred4x4[HOR_PRED            ]= FUNCC(pred4x4_horizontal        , depth);\
479
481
        h->pred8x8[VERT_PRED8x8   ]= FUNCC(pred8x16_vertical              , depth);\
480
482
        h->pred8x8[HOR_PRED8x8    ]= FUNCC(pred8x16_horizontal            , depth);\
481
483
    }\
482
 
    if (codec_id != AV_CODEC_ID_VP8) {\
 
484
    if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {\
483
485
        if (chroma_format_idc <= 1) {\
484
486
            h->pred8x8[PLANE_PRED8x8]= FUNCC(pred8x8_plane                , depth);\
485
487
        } else {\
487
489
        }\
488
490
    } else\
489
491
        h->pred8x8[PLANE_PRED8x8]= FUNCD(pred8x8_tm_vp8);\
490
 
    if(codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP8){\
 
492
    if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 && \
 
493
        codec_id != AV_CODEC_ID_VP8) {\
491
494
        if (chroma_format_idc <= 1) {\
492
495
            h->pred8x8[DC_PRED8x8     ]= FUNCC(pred8x8_dc                     , depth);\
493
496
            h->pred8x8[LEFT_DC_PRED8x8]= FUNCC(pred8x8_left_dc                , depth);\
509
512
        h->pred8x8[DC_PRED8x8     ]= FUNCD(pred8x8_dc_rv40);\
510
513
        h->pred8x8[LEFT_DC_PRED8x8]= FUNCD(pred8x8_left_dc_rv40);\
511
514
        h->pred8x8[TOP_DC_PRED8x8 ]= FUNCD(pred8x8_top_dc_rv40);\
512
 
        if (codec_id == AV_CODEC_ID_VP8) {\
 
515
        if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {\
513
516
            h->pred8x8[DC_127_PRED8x8]= FUNCC(pred8x8_127_dc              , depth);\
514
517
            h->pred8x8[DC_129_PRED8x8]= FUNCC(pred8x8_129_dc              , depth);\
515
518
        }\
530
533
    case AV_CODEC_ID_RV40:\
531
534
       h->pred16x16[PLANE_PRED8x8  ]= FUNCD(pred16x16_plane_rv40);\
532
535
       break;\
 
536
    case AV_CODEC_ID_VP7:\
533
537
    case AV_CODEC_ID_VP8:\
534
538
       h->pred16x16[PLANE_PRED8x8  ]= FUNCD(pred16x16_tm_vp8);\
535
539
       h->pred16x16[DC_127_PRED8x8]= FUNCC(pred16x16_127_dc               , depth);\