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

« back to all changes in this revision

Viewing changes to libavcodec/intrax8.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:
24
24
#include "avcodec.h"
25
25
#include "error_resilience.h"
26
26
#include "get_bits.h"
 
27
#include "idctdsp.h"
27
28
#include "mpegvideo.h"
28
29
#include "msmpeg4data.h"
29
30
#include "intrax8huf.h"
306
307
    int quant;
307
308
 
308
309
    w->dsp.setup_spatial_compensation(s->dest[chroma], s->edge_emu_buffer,
309
 
                                      s->current_picture.f.linesize[chroma>0],
 
310
                                      s->current_picture.f->linesize[chroma>0],
310
311
                                      &range, &sum, w->edges);
311
312
    if(chroma){
312
313
        w->orient=w->chroma_orient;
440
441
static void x8_ac_compensation(IntraX8Context * const w, int const direction, int const dc_level){
441
442
    MpegEncContext * const s= w->s;
442
443
    int t;
443
 
#define B(x,y)  s->block[0][s->dsp.idct_permutation[(x)+(y)*8]]
 
444
#define B(x, y) s->block[0][s->idsp.idct_permutation[(x) + (y) * 8]]
444
445
#define T(x)  ((x) * dc_level + 0x8000) >> 16;
445
446
    switch(direction){
446
447
    case 0:
538
539
    int sign;
539
540
 
540
541
    assert(w->orient<12);
541
 
    s->dsp.clear_block(s->block[0]);
 
542
    s->bdsp.clear_block(s->block[0]);
542
543
 
543
544
    if(chroma){
544
545
        dc_mode=2;
615
616
            dc_level+= (w->predicted_dc*divide_quant + (1<<12) )>>13;
616
617
 
617
618
            dsp_x8_put_solidcolor( av_clip_uint8((dc_level*dc_quant+4)>>3),
618
 
                                   s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
 
619
                                   s->dest[chroma], s->current_picture.f->linesize[!!chroma]);
619
620
 
620
621
            goto block_placed;
621
622
        }
639
640
    }
640
641
 
641
642
    if(w->flat_dc){
642
 
        dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f.linesize[!!chroma]);
 
643
        dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f->linesize[!!chroma]);
643
644
    }else{
644
645
        w->dsp.spatial_compensation[w->orient]( s->edge_emu_buffer,
645
646
                                            s->dest[chroma],
646
 
                                            s->current_picture.f.linesize[!!chroma] );
 
647
                                            s->current_picture.f->linesize[!!chroma] );
647
648
    }
648
649
    if(!zeros_only)
649
 
        s->dsp.idct_add ( s->dest[chroma],
650
 
                          s->current_picture.f.linesize[!!chroma],
651
 
                          s->block[0] );
 
650
        s->idsp.idct_add(s->dest[chroma],
 
651
                         s->current_picture.f->linesize[!!chroma],
 
652
                         s->block[0]);
652
653
 
653
654
block_placed:
654
655
 
658
659
 
659
660
    if(s->loop_filter){
660
661
        uint8_t* ptr = s->dest[chroma];
661
 
        int linesize = s->current_picture.f.linesize[!!chroma];
 
662
        int linesize = s->current_picture.f->linesize[!!chroma];
662
663
 
663
664
        if(!( (w->edges&2) || ( zeros_only && (w->orient|4)==4 ) )){
664
665
            w->dsp.h_loop_filter(ptr, linesize, w->quant);
673
674
static void x8_init_block_index(MpegEncContext *s){ //FIXME maybe merge with ff_*
674
675
//not s->linesize as this would be wrong for field pics
675
676
//not that IntraX8 has interlacing support ;)
676
 
    const int linesize   = s->current_picture.f.linesize[0];
677
 
    const int uvlinesize = s->current_picture.f.linesize[1];
 
677
    const int linesize   = s->current_picture.f->linesize[0];
 
678
    const int uvlinesize = s->current_picture.f->linesize[1];
678
679
 
679
 
    s->dest[0] = s->current_picture.f.data[0];
680
 
    s->dest[1] = s->current_picture.f.data[1];
681
 
    s->dest[2] = s->current_picture.f.data[2];
 
680
    s->dest[0] = s->current_picture.f->data[0];
 
681
    s->dest[1] = s->current_picture.f->data[1];
 
682
    s->dest[2] = s->current_picture.f->data[2];
682
683
 
683
684
    s->dest[0] +=   s->mb_y        *   linesize << 3;
684
685
    s->dest[1] += ( s->mb_y&(~1) ) * uvlinesize << 2;//chroma blocks are on add rows
698
699
    assert(s->mb_width>0);
699
700
    w->prediction_table=av_mallocz(s->mb_width*2*2);//two rows, 2 blocks per cannon mb
700
701
 
701
 
    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[0], ff_wmv1_scantable[0]);
702
 
    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[1], ff_wmv1_scantable[2]);
703
 
    ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], ff_wmv1_scantable[3]);
 
702
    ff_init_scantable(s->idsp.idct_permutation, &w->scantable[0], ff_wmv1_scantable[0]);
 
703
    ff_init_scantable(s->idsp.idct_permutation, &w->scantable[1], ff_wmv1_scantable[2]);
 
704
    ff_init_scantable(s->idsp.idct_permutation, &w->scantable[2], ff_wmv1_scantable[3]);
704
705
 
705
706
    ff_intrax8dsp_init(&w->dsp);
706
707
}
717
718
/**
718
719
 * Decode single IntraX8 frame.
719
720
 * The parent codec must fill s->loopfilter and s->gb (bitstream).
720
 
 * The parent codec must call MPV_frame_start(), ff_er_frame_start() before calling this function.
721
 
 * The parent codec must call ff_er_frame_end(), MPV_frame_end() after calling this function.
722
 
 * This function does not use MPV_decode_mb().
 
721
 * The parent codec must call ff_mpv_frame_start(), ff_er_frame_start() before calling this function.
 
722
 * The parent codec must call ff_er_frame_end(), ff_mpv_frame_end() after calling this function.
 
723
 * This function does not use ff_mpv_decode_mb().
723
724
 * @param w pointer to IntraX8Context
724
725
 * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1.
725
726
 * @param quant_offset offset away from zero