| OLD | NEW |
| 1 /* | 1 /* |
| 2 * RAW muxer and demuxer | 2 * RAW muxer and demuxer |
| 3 * Copyright (c) 2001 Fabrice Bellard | 3 * Copyright (c) 2001 Fabrice Bellard |
| 4 * Copyright (c) 2005 Alex Beregszaszi | 4 * Copyright (c) 2005 Alex Beregszaszi |
| 5 * | 5 * |
| 6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
| 7 * | 7 * |
| 8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 450 |
| 451 #if CONFIG_H263_DEMUXER | 451 #if CONFIG_H263_DEMUXER |
| 452 static int h263_probe(AVProbeData *p) | 452 static int h263_probe(AVProbeData *p) |
| 453 { | 453 { |
| 454 uint64_t code= -1; | 454 uint64_t code= -1; |
| 455 int i; | 455 int i; |
| 456 int valid_psc=0; | 456 int valid_psc=0; |
| 457 int invalid_psc=0; | 457 int invalid_psc=0; |
| 458 int res_change=0; | 458 int res_change=0; |
| 459 int src_fmt, last_src_fmt=-1; | 459 int src_fmt, last_src_fmt=-1; |
| 460 int last_gn=0; |
| 460 | 461 |
| 461 for(i=0; i<p->buf_size; i++){ | 462 for(i=0; i<p->buf_size; i++){ |
| 462 code = (code<<8) + p->buf[i]; | 463 code = (code<<8) + p->buf[i]; |
| 463 if ((code & 0xfffffc0000) == 0x800000) { | 464 if ((code & 0xfffffc0000) == 0x800000) { |
| 464 src_fmt= (code>>2)&3; | 465 src_fmt= (code>>2)&3; |
| 465 if( src_fmt != last_src_fmt | 466 if( src_fmt != last_src_fmt |
| 466 && last_src_fmt>0 && last_src_fmt<6 | 467 && last_src_fmt>0 && last_src_fmt<6 |
| 467 && src_fmt<6) | 468 && src_fmt<6) |
| 468 res_change++; | 469 res_change++; |
| 469 | 470 |
| 470 if((code&0x300)==0x200 && src_fmt){ | 471 if((code&0x300)==0x200 && src_fmt){ |
| 471 valid_psc++; | 472 valid_psc++; |
| 473 last_gn=0; |
| 472 }else | 474 }else |
| 473 invalid_psc++; | 475 invalid_psc++; |
| 474 last_src_fmt= src_fmt; | 476 last_src_fmt= src_fmt; |
| 477 } else if((code & 0xffff800000) == 0x800000) { |
| 478 int gn= (code>>(23-5)) & 0x1F; |
| 479 if(gn<last_gn){ |
| 480 invalid_psc++; |
| 481 }else |
| 482 last_gn= gn; |
| 475 } | 483 } |
| 476 } | 484 } |
| 477 //av_log(NULL, AV_LOG_ERROR, "h263_probe: psc:%d invalid:%d res_change:%d\n", va
lid_psc, invalid_psc, res_change); | 485 //av_log(NULL, AV_LOG_ERROR, "h263_probe: psc:%d invalid:%d res_change:%d\n", va
lid_psc, invalid_psc, res_change); |
| 478 //h263_probe: psc:3 invalid:0 res_change:0 (1588/recent_ffmpeg_parses_mpg_incorr
ectly.mpg) | 486 //h263_probe: psc:3 invalid:0 res_change:0 (1588/recent_ffmpeg_parses_mpg_incorr
ectly.mpg) |
| 479 if(valid_psc > 2*invalid_psc + 2*res_change + 3){ | 487 if(valid_psc > 2*invalid_psc + 2*res_change + 3){ |
| 480 return 50; | 488 return 50; |
| 481 }else if(valid_psc > 2*invalid_psc) | 489 }else if(valid_psc > 2*invalid_psc) |
| 482 return 25; | 490 return 25; |
| 483 return 0; | 491 return 0; |
| 484 } | 492 } |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 LE_DEF("uw"), CODEC_ID_PCM_U16LE) | 1363 LE_DEF("uw"), CODEC_ID_PCM_U16LE) |
| 1356 | 1364 |
| 1357 PCMDEF(u8, "PCM unsigned 8 bit format", | 1365 PCMDEF(u8, "PCM unsigned 8 bit format", |
| 1358 "ub", CODEC_ID_PCM_U8) | 1366 "ub", CODEC_ID_PCM_U8) |
| 1359 | 1367 |
| 1360 PCMDEF(alaw, "PCM A-law format", | 1368 PCMDEF(alaw, "PCM A-law format", |
| 1361 "al", CODEC_ID_PCM_ALAW) | 1369 "al", CODEC_ID_PCM_ALAW) |
| 1362 | 1370 |
| 1363 PCMDEF(mulaw, "PCM mu-law format", | 1371 PCMDEF(mulaw, "PCM mu-law format", |
| 1364 "ul", CODEC_ID_PCM_MULAW) | 1372 "ul", CODEC_ID_PCM_MULAW) |
| OLD | NEW |