~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/svq3.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
    }
289
289
 
290
290
    /* form component predictions */
291
 
    dest = s->current_picture.data[0] + x + y*s->linesize;
292
 
    src  = pic->data[0] + mx + my*s->linesize;
 
291
    dest = s->current_picture.f.data[0] + x + y*s->linesize;
 
292
    src  = pic->f.data[0] + mx + my*s->linesize;
293
293
 
294
294
    if (emu) {
295
295
        s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, (width + 1), (height + 1),
309
309
        blocksize++;
310
310
 
311
311
        for (i = 1; i < 3; i++) {
312
 
            dest = s->current_picture.data[i] + (x >> 1) + (y >> 1)*s->uvlinesize;
313
 
            src  = pic->data[i] + mx + my*s->uvlinesize;
 
312
            dest = s->current_picture.f.data[i] + (x >> 1) + (y >> 1) * s->uvlinesize;
 
313
            src  = pic->f.data[i] + mx + my * s->uvlinesize;
314
314
 
315
315
            if (emu) {
316
316
                s->dsp.emulated_edge_mc(s->edge_emu_buffer, src, s->uvlinesize, (width + 1), (height + 1),
347
347
            if (mode != PREDICT_MODE) {
348
348
                pred_motion(h, k, (part_width >> 2), dir, 1, &mx, &my);
349
349
            } else {
350
 
                mx = s->next_picture.motion_val[0][b_xy][0]<<1;
351
 
                my = s->next_picture.motion_val[0][b_xy][1]<<1;
 
350
                mx = s->next_picture.f.motion_val[0][b_xy][0] << 1;
 
351
                my = s->next_picture.f.motion_val[0][b_xy][1] << 1;
352
352
 
353
353
                if (dir == 0) {
354
354
                    mx = ((mx * h->frame_num_offset) / h->prev_frame_num_offset + 1) >> 1;
425
425
            }
426
426
 
427
427
            /* write back motion vectors */
428
 
            fill_rectangle(s->current_picture.motion_val[dir][b_xy], part_width>>2, part_height>>2, h->b_stride, pack16to32(mx,my), 4);
 
428
            fill_rectangle(s->current_picture.f.motion_val[dir][b_xy],
 
429
                           part_width >> 2, part_height >> 2, h->b_stride,
 
430
                           pack16to32(mx, my), 4);
429
431
        }
430
432
    }
431
433
 
448
450
    h->topright_samples_available = 0xFFFF;
449
451
 
450
452
    if (mb_type == 0) {           /* SKIP */
451
 
        if (s->pict_type == AV_PICTURE_TYPE_P || s->next_picture.mb_type[mb_xy] == -1) {
 
453
        if (s->pict_type == AV_PICTURE_TYPE_P || s->next_picture.f.mb_type[mb_xy] == -1) {
452
454
            svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0);
453
455
 
454
456
            if (s->pict_type == AV_PICTURE_TYPE_B) {
457
459
 
458
460
            mb_type = MB_TYPE_SKIP;
459
461
        } else {
460
 
            mb_type = FFMIN(s->next_picture.mb_type[mb_xy], 6);
 
462
            mb_type = FFMIN(s->next_picture.f.mb_type[mb_xy], 6);
461
463
            if (svq3_mc_dir(h, mb_type, PREDICT_MODE, 0, 0) < 0)
462
464
                return -1;
463
465
            if (svq3_mc_dir(h, mb_type, PREDICT_MODE, 1, 1) < 0)
486
488
        for (m = 0; m < 2; m++) {
487
489
            if (s->mb_x > 0 && h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1]+6] != -1) {
488
490
                for (i = 0; i < 4; i++) {
489
 
                    *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - 1 + i*h->b_stride];
 
491
                    *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = *(uint32_t *) s->current_picture.f.motion_val[m][b_xy - 1 + i*h->b_stride];
490
492
                }
491
493
            } else {
492
494
                for (i = 0; i < 4; i++) {
494
496
                }
495
497
            }
496
498
            if (s->mb_y > 0) {
497
 
                memcpy(h->mv_cache[m][scan8[0] - 1*8], s->current_picture.motion_val[m][b_xy - h->b_stride], 4*2*sizeof(int16_t));
 
499
                memcpy(h->mv_cache[m][scan8[0] - 1*8], s->current_picture.f.motion_val[m][b_xy - h->b_stride], 4*2*sizeof(int16_t));
498
500
                memset(&h->ref_cache[m][scan8[0] - 1*8], (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4);
499
501
 
500
502
                if (s->mb_x < (s->mb_width - 1)) {
501
 
                    *(uint32_t *) h->mv_cache[m][scan8[0] + 4 - 1*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - h->b_stride + 4];
 
503
                    *(uint32_t *) h->mv_cache[m][scan8[0] + 4 - 1*8] = *(uint32_t *) s->current_picture.f.motion_val[m][b_xy - h->b_stride + 4];
502
504
                    h->ref_cache[m][scan8[0] + 4 - 1*8] =
503
505
                        (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride + 1]+6] == -1 ||
504
506
                         h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride    ]  ] == -1) ? PART_NOT_AVAILABLE : 1;
505
507
                }else
506
508
                    h->ref_cache[m][scan8[0] + 4 - 1*8] = PART_NOT_AVAILABLE;
507
509
                if (s->mb_x > 0) {
508
 
                    *(uint32_t *) h->mv_cache[m][scan8[0] - 1 - 1*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - h->b_stride - 1];
 
510
                    *(uint32_t *) h->mv_cache[m][scan8[0] - 1 - 1*8] = *(uint32_t *) s->current_picture.f.motion_val[m][b_xy - h->b_stride - 1];
509
511
                    h->ref_cache[m][scan8[0] - 1 - 1*8] = (h->intra4x4_pred_mode[h->mb2br_xy[mb_xy - s->mb_stride - 1]+3] == -1) ? PART_NOT_AVAILABLE : 1;
510
512
                }else
511
513
                    h->ref_cache[m][scan8[0] - 1 - 1*8] = PART_NOT_AVAILABLE;
526
528
                    return -1;
527
529
            } else {
528
530
                for (i = 0; i < 4; i++) {
529
 
                    memset(s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
 
531
                    memset(s->current_picture.f.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
530
532
                }
531
533
            }
532
534
            if (mb_type != 1) {
534
536
                    return -1;
535
537
            } else {
536
538
                for (i = 0; i < 4; i++) {
537
 
                    memset(s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
 
539
                    memset(s->current_picture.f.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
538
540
                }
539
541
            }
540
542
        }
589
591
            }
590
592
        }
591
593
 
592
 
        ff_h264_write_back_intra_pred_mode(h);
 
594
        write_back_intra_pred_mode(h);
593
595
 
594
596
        if (mb_type == 8) {
595
597
            ff_h264_check_intra4x4_pred_mode(h);
621
623
 
622
624
    if (!IS_INTER(mb_type) && s->pict_type != AV_PICTURE_TYPE_I) {
623
625
        for (i = 0; i < 4; i++) {
624
 
            memset(s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
 
626
            memset(s->current_picture.f.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
625
627
        }
626
628
        if (s->pict_type == AV_PICTURE_TYPE_B) {
627
629
            for (i = 0; i < 4; i++) {
628
 
                memset(s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
 
630
                memset(s->current_picture.f.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
629
631
            }
630
632
        }
631
633
    }
706
708
    }
707
709
 
708
710
    h->cbp= cbp;
709
 
    s->current_picture.mb_type[mb_xy] = mb_type;
 
711
    s->current_picture.f.mb_type[mb_xy] = mb_type;
710
712
 
711
713
    if (IS_INTRA(mb_type)) {
712
714
        h->chroma_pred_mode = ff_h264_check_intra_pred_mode(h, DC_PRED8x8);
922
924
 
923
925
        h->b_stride = 4*s->mb_width;
924
926
 
925
 
        ff_h264_alloc_tables(h);
 
927
        if (ff_h264_alloc_tables(h) < 0) {
 
928
            av_log(avctx, AV_LOG_ERROR, "svq3 memory allocation failed\n");
 
929
            return AVERROR(ENOMEM);
 
930
        }
926
931
    }
927
932
 
928
933
    return 0;
966
971
    }
967
972
 
968
973
    /* for skipping the frame */
969
 
    s->current_picture.pict_type = s->pict_type;
970
 
    s->current_picture.key_frame = (s->pict_type == AV_PICTURE_TYPE_I);
 
974
    s->current_picture.f.pict_type = s->pict_type;
 
975
    s->current_picture.f.key_frame = (s->pict_type == AV_PICTURE_TYPE_I);
971
976
 
972
977
    /* Skip B-frames if we do not have reference frames. */
973
978
    if (s->last_picture_ptr == NULL && s->pict_type == AV_PICTURE_TYPE_B)
1051
1056
            }
1052
1057
 
1053
1058
            if (s->pict_type != AV_PICTURE_TYPE_B && !s->low_delay) {
1054
 
                s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride] =
 
1059
                s->current_picture.f.mb_type[s->mb_x + s->mb_y * s->mb_stride] =
1055
1060
                    (s->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
1056
1061
            }
1057
1062
        }
1089
1094
}
1090
1095
 
1091
1096
AVCodec ff_svq3_decoder = {
1092
 
    "svq3",
1093
 
    AVMEDIA_TYPE_VIDEO,
1094
 
    CODEC_ID_SVQ3,
1095
 
    sizeof(SVQ3Context),
1096
 
    svq3_decode_init,
1097
 
    NULL,
1098
 
    svq3_decode_end,
1099
 
    svq3_decode_frame,
1100
 
    CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
 
1097
    .name           = "svq3",
 
1098
    .type           = AVMEDIA_TYPE_VIDEO,
 
1099
    .id             = CODEC_ID_SVQ3,
 
1100
    .priv_data_size = sizeof(SVQ3Context),
 
1101
    .init           = svq3_decode_init,
 
1102
    .close          = svq3_decode_end,
 
1103
    .decode         = svq3_decode_frame,
 
1104
    .capabilities   = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
1101
1105
    .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
1102
1106
    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_NONE},
1103
1107
};