~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to libavformat/mpegvideodec.c

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "avformat.h"
24
24
#include "rawdec.h"
25
25
 
 
26
#include "libavutil/intreadwrite.h"
 
27
 
26
28
#define SEQ_START_CODE          0x000001b3
27
29
#define GOP_START_CODE          0x000001b8
28
30
#define PICTURE_START_CODE      0x00000100
35
37
{
36
38
    uint32_t code= -1;
37
39
    int pic=0, seq=0, slice=0, pspack=0, vpes=0, apes=0, res=0, sicle=0;
38
 
    int i;
 
40
    int i, j;
39
41
    uint32_t last = 0;
40
42
 
41
43
    for(i=0; i<p->buf_size; i++){
42
44
        code = (code<<8) + p->buf[i];
43
45
        if ((code & 0xffffff00) == 0x100) {
44
46
            switch(code){
45
 
            case     SEQ_START_CODE:   seq++; break;
 
47
            case     SEQ_START_CODE:
 
48
                if (!(p->buf[i+1+3+1+2] & 0x20))
 
49
                    break;
 
50
                j = i;
 
51
                if (p->buf[j+8] & 2)
 
52
                    j+= 64;
 
53
                if (j >= p->buf_size)
 
54
                    break;
 
55
                if (p->buf[j+8] & 1)
 
56
                    j+= 64;
 
57
                if (j >= p->buf_size)
 
58
                    break;
 
59
                if (AV_RB24(p->buf + j + 9) & 0xFFFFFE)
 
60
                    break;
 
61
                seq++;
 
62
            break;
46
63
            case PICTURE_START_CODE:   pic++; break;
47
64
            case    PACK_START_CODE: pspack++; break;
48
65
            case              0x1b6: