ffmpeg-cvslog
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
December 2005
- 25 participants
- 132 discussions
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv4502
Modified Files:
motion_est.c
Log Message:
10l (segfault fix)
Index: motion_est.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- motion_est.c 23 Dec 2005 16:25:00 -0000 1.114
+++ motion_est.c 23 Dec 2005 19:05:48 -0000 1.115
@@ -1646,14 +1646,17 @@
if(s->avctx->bidir_refine){
int score, end;
#define CHECK_BIDIR(fx,fy,bx,by)\
- score= check_bidir_mv(s, motion_fx+fx, motion_fy+fy, motion_bx+bx, motion_by+by, pred_fx, pred_fy, pred_bx, pred_by, 0, 16);\
- if(score < fbmin){\
- fbmin= score;\
- motion_fx+=fx;\
- motion_fy+=fy;\
- motion_bx+=bx;\
- motion_by+=by;\
- end=0;\
+ if( (fx<=0 || motion_fx+fx<=xmax) && (fy<=0 || motion_fy+fy<=ymax) && (bx<=0 || motion_bx+bx<=xmax) && (by<=0 || motion_by+by<=ymax)\
+ &&(fx>=0 || motion_fx+fx>=xmin) && (fy>=0 || motion_fy+fy>=ymin) && (bx>=0 || motion_bx+bx>=xmin) && (by>=0 || motion_by+by>=ymin)){\
+ score= check_bidir_mv(s, motion_fx+fx, motion_fy+fy, motion_bx+bx, motion_by+by, pred_fx, pred_fy, pred_bx, pred_by, 0, 16);\
+ if(score < fbmin){\
+ fbmin= score;\
+ motion_fx+=fx;\
+ motion_fy+=fy;\
+ motion_bx+=bx;\
+ motion_by+=by;\
+ end=0;\
+ }\
}
#define CHECK_BIDIR2(a,b,c,d)\
CHECK_BIDIR(a,b,c,d)\
@@ -1668,10 +1671,6 @@
do{
end=1;
- if( motion_fx >= xmax || motion_bx >= xmax || motion_fx <= xmin || motion_bx <= xmin
- || motion_fy >= ymax || motion_by >= ymax || motion_fy <= ymin || motion_by <= ymin)
- break;
-
CHECK_BIDIRR( 0, 0, 0, 1)
if(s->avctx->bidir_refine > 1){
CHECK_BIDIRR( 0, 0, 1, 1)
1
0
CVS: ffmpeg/tests ffmpeg.regression.ref, 1.146, 1.147 rotozoom.regression.ref, 1.101, 1.102
by michael@mplayerhq.hu 23 Dec '05
by michael@mplayerhq.hu 23 Dec '05
23 Dec '05
Update of /cvsroot/ffmpeg/ffmpeg/tests
In directory mail:/var2/tmp/cvs-serv17698/tests
Modified Files:
ffmpeg.regression.ref rotozoom.regression.ref
Log Message:
minor typo
Index: ffmpeg.regression.ref
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/tests/ffmpeg.regression.ref,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- ffmpeg.regression.ref 22 Dec 2005 14:17:54 -0000 1.146
+++ ffmpeg.regression.ref 23 Dec 2005 00:40:52 -0000 1.147
@@ -15,13 +15,13 @@
754366 ./data/a-mpeg2i.mpg
ddf889858529d09c8fe31c701deacd16 *./data/out.yuv
stddev: 7.71 PSNR:30.37 bytes:7602176
-781531fff6e20c986a3bcc189fc34e98 *./data/a-mpeg2thread.mpg
-816506 ./data/a-mpeg2thread.mpg
-9db3aca554bb8ee337a109a3b8629575 *./data/out.yuv
+d0830d912bc594eeec4d3ec60d727d15 *./data/a-mpeg2thread.mpg
+816727 ./data/a-mpeg2thread.mpg
+664c5ac9185522238813c476b7b0570a *./data/out.yuv
stddev: 7.64 PSNR:30.45 bytes:7602176
-6e51bb9da148f9128fde429089349c43 *./data/a-mpeg2reuse.mpg
-2115703 ./data/a-mpeg2reuse.mpg
-526e6e6818296a1b63d91fc165e0bda8 *./data/out.yuv
+d948e29c0be5a78b75c0c7f3ecd8d29d *./data/a-mpeg2reuse.mpg
+2114000 ./data/a-mpeg2reuse.mpg
+55e78a12330b374db6910447db78ad46 *./data/out.yuv
stddev: 7.68 PSNR:30.41 bytes:7602176
09086e7b020e9425a8f7e05372dbcfcd *./data/a-msmpeg4v2.avi
642666 ./data/a-msmpeg4v2.avi
@@ -59,9 +59,9 @@
7932708 ./data/a-huffyuv.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
-fc4c71c330fd3f95e05c398c6a7584de *./data/a-mpeg4-rc.avi
-824306 ./data/a-mpeg4-rc.avi
-fb0a9af6dd83b2f1a3ba752b848038f7 *./data/out.yuv
+cd541209c9ef0c1824ac340d5087f0e0 *./data/a-mpeg4-rc.avi
+824336 ./data/a-mpeg4-rc.avi
+6656c0be50eba458b5ab91bfe6bf3077 *./data/out.yuv
stddev: 10.41 PSNR:27.77 bytes:7602176
81078d7852dfd6041ff17b5dc8ed0ffc *./data/a-mpeg4-adv.avi
600240 ./data/a-mpeg4-adv.avi
@@ -83,9 +83,9 @@
689772 ./data/a-mpeg4-nr.avi
79f4e8263e40822c0cbf35725f375b24 *./data/out.yuv
stddev: 7.03 PSNR:31.18 bytes:7602176
-6aebee12c0ff95756e11d32f305d7e11 *./data/a-mpeg1b.mpg
-1037657 ./data/a-mpeg1b.mpg
-09a77de112e144c562bc1398b111b61b *./data/out.yuv
+9060d865a32d5c760ab51df013c0aece *./data/a-mpeg1b.mpg
+1037617 ./data/a-mpeg1b.mpg
+cb5b972265599c17f01b96737947b482 *./data/out.yuv
stddev: 6.35 PSNR:32.06 bytes:7602176
f7562207c0e7490e570c91c2900b73f6 *./data/a-mjpeg.avi
1566544 ./data/a-mjpeg.avi
Index: rotozoom.regression.ref
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/tests/rotozoom.regression.ref,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- rotozoom.regression.ref 22 Dec 2005 14:17:54 -0000 1.101
+++ rotozoom.regression.ref 23 Dec 2005 00:40:52 -0000 1.102
@@ -15,13 +15,13 @@
205006 ./data/a-mpeg2i.mpg
d215d0f3cbbfb687a929ccf2dd1a034a *./data/out.yuv
stddev: 4.99 PSNR:34.16 bytes:7602176
-80d7c5f8159094ba5497d9b890906ee5 *./data/a-mpeg2thread.mpg
-184101 ./data/a-mpeg2thread.mpg
-abc276d30f874cb36d2fa113dabc67a8 *./data/out.yuv
+20f7d29ae2d7eed5742b22c9d2ed5281 *./data/a-mpeg2thread.mpg
+184113 ./data/a-mpeg2thread.mpg
+b6cc35f5619c6f44c1c2bfbf01e55aec *./data/out.yuv
stddev: 4.76 PSNR:34.56 bytes:7602176
-0dfacb76a7097614c2dddd27b25f1162 *./data/a-mpeg2reuse.mpg
-397244 ./data/a-mpeg2reuse.mpg
-caa7723366dd267a5a14775565f2df2e *./data/out.yuv
+57bc4a05ff7053dc988530714e91f6c2 *./data/a-mpeg2reuse.mpg
+397335 ./data/a-mpeg2reuse.mpg
+4f6b4006112516a6f939d61876f78eca *./data/out.yuv
stddev: 4.77 PSNR:34.54 bytes:7602176
dc68a5115d1bf1bb2eb2ce9bb237bd79 *./data/a-msmpeg4v2.avi
129504 ./data/a-msmpeg4v2.avi
@@ -83,9 +83,9 @@
154392 ./data/a-mpeg4-nr.avi
33a6f702049ef4e074c6266b9d17d3e9 *./data/out.yuv
stddev: 4.73 PSNR:34.61 bytes:7602176
-5ebacda3ae827549f7df10ce0361f617 *./data/a-mpeg1b.mpg
-231306 ./data/a-mpeg1b.mpg
-c665bd56f8e241f8bf3a5a8f803227c3 *./data/out.yuv
+1286f6db500a739f724994991be211b0 *./data/a-mpeg1b.mpg
+231292 ./data/a-mpeg1b.mpg
+a0eeed27d5123995b32210dc35052cfe *./data/out.yuv
stddev: 4.13 PSNR:35.78 bytes:7602176
213976bbab45a461e3334feb8fef38d9 *./data/a-mjpeg.avi
702528 ./data/a-mjpeg.avi
1
0
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv17698/libavcodec
Modified Files:
motion_est.c
Log Message:
minor typo
Index: motion_est.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- motion_est.c 22 Dec 2005 01:10:08 -0000 1.112
+++ motion_est.c 23 Dec 2005 00:40:52 -0000 1.113
@@ -1561,7 +1561,8 @@
//FIXME better f_code prediction (max mv & distance)
//FIXME pointers
MotionEstContext * const c= &s->me;
- uint8_t * const mv_penalty= c->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
+ uint8_t * const mv_penalty_f= c->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
+ uint8_t * const mv_penalty_b= c->mv_penalty[s->b_code] + MAX_MV; // f_code of the prev frame
int stride= c->stride;
uint8_t *dest_y = c->scratchpad;
uint8_t *ptr;
@@ -1602,8 +1603,8 @@
s->dsp.avg_pixels_tab[size][dxy](dest_y , ptr , stride, h);
}
- fbmin = (mv_penalty[motion_fx-pred_fx] + mv_penalty[motion_fy-pred_fy])*c->mb_penalty_factor
- +(mv_penalty[motion_bx-pred_bx] + mv_penalty[motion_by-pred_by])*c->mb_penalty_factor
+ fbmin = (mv_penalty_f[motion_fx-pred_fx] + mv_penalty_f[motion_fy-pred_fy])*c->mb_penalty_factor
+ +(mv_penalty_b[motion_bx-pred_bx] + mv_penalty_b[motion_by-pred_by])*c->mb_penalty_factor
+ s->dsp.mb_cmp[size](s, src_data[0], dest_y, stride, h); //FIXME new_pic
if(c->avctx->mb_cmp&FF_CMP_CHROMA){
1
0
CVS: ffmpeg/libavcodec mpegvideo.c, 1.497, 1.498 mpegvideo.h, 1.229, 1.230 ratecontrol.c, 1.51, 1.52
by michael@mplayerhq.hu 22 Dec '05
by michael@mplayerhq.hu 22 Dec '05
22 Dec '05
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv16911
Modified Files:
mpegvideo.c mpegvideo.h ratecontrol.c
Log Message:
better f_code guessing in 2nd pass
Index: mpegvideo.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v
retrieving revision 1.497
retrieving revision 1.498
diff -u -d -r1.497 -r1.498
--- mpegvideo.c 22 Dec 2005 14:17:54 -0000 1.497
+++ mpegvideo.c 22 Dec 2005 22:48:09 -0000 1.498
@@ -5298,9 +5298,10 @@
s->no_rounding ^= 1;
}
- if(s->flags & CODEC_FLAG_PASS2)
+ if(s->flags & CODEC_FLAG_PASS2){
estimate_qp(s, 1);
- else if(!(s->flags & CODEC_FLAG_QSCALE)){
+ ff_get_2pass_fcode(s);
+ }else if(!(s->flags & CODEC_FLAG_QSCALE)){
RateControlContext *rcc= &s->rc_context;
if(s->pict_type==B_TYPE)
Index: mpegvideo.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.h,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -d -r1.229 -r1.230
--- mpegvideo.h 22 Dec 2005 01:10:08 -0000 1.229
+++ mpegvideo.h 22 Dec 2005 22:48:09 -0000 1.230
@@ -980,6 +980,6 @@
double (**func2)(void *, double, double), char **func2_name,
void *opaque);
int ff_vbv_update(MpegEncContext *s, int frame_size);
-
+void ff_get_2pass_fcode(MpegEncContext *s);
#endif /* AVCODEC_MPEGVIDEO_H */
Index: ratecontrol.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/ratecontrol.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- ratecontrol.c 19 Dec 2005 13:41:27 -0000 1.51
+++ ratecontrol.c 22 Dec 2005 22:48:09 -0000 1.52
@@ -607,6 +607,17 @@
s->lambda_table[mb_xy]= intq;
}
}
+
+void ff_get_2pass_fcode(MpegEncContext *s){
+ RateControlContext *rcc= &s->rc_context;
+ int picture_number= s->picture_number;
+ RateControlEntry *rce;
+
+ rce= &rcc->entry[picture_number];
+ s->f_code= rce->f_code;
+ s->b_code= rce->b_code;
+}
+
//FIXME rd or at least approx for dquant
float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
1
0
CVS: ffmpeg/tests ffmpeg.regression.ref, 1.145, 1.146 rotozoom.regression.ref, 1.100, 1.101
by michael@mplayerhq.hu 22 Dec '05
by michael@mplayerhq.hu 22 Dec '05
22 Dec '05
Update of /cvsroot/ffmpeg/ffmpeg/tests
In directory mail:/var2/tmp/cvs-serv20080/tests
Modified Files:
ffmpeg.regression.ref rotozoom.regression.ref
Log Message:
improved lambda/qp guessing for motion estimation RD in first pass
this only affects encoding with bframes and rate control
Index: ffmpeg.regression.ref
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/tests/ffmpeg.regression.ref,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- ffmpeg.regression.ref 5 Sep 2005 10:26:10 -0000 1.145
+++ ffmpeg.regression.ref 22 Dec 2005 14:17:54 -0000 1.146
@@ -59,18 +59,18 @@
7932708 ./data/a-huffyuv.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
-24f8d8a1c15c078f1f1e443b85688444 *./data/a-mpeg4-rc.avi
-820964 ./data/a-mpeg4-rc.avi
-8458b4ddaca643a3ec1264c1ee2f4986 *./data/out.yuv
+fc4c71c330fd3f95e05c398c6a7584de *./data/a-mpeg4-rc.avi
+824306 ./data/a-mpeg4-rc.avi
+fb0a9af6dd83b2f1a3ba752b848038f7 *./data/out.yuv
stddev: 10.41 PSNR:27.77 bytes:7602176
81078d7852dfd6041ff17b5dc8ed0ffc *./data/a-mpeg4-adv.avi
600240 ./data/a-mpeg4-adv.avi
0b7935cee2070f3b838478cea6dc4b3c *./data/out.yuv
stddev: 10.25 PSNR:27.90 bytes:7602176
-c5478162c76db62162b082594c4e7ee1 *./data/a-mpeg4-thread.avi
-756550 ./data/a-mpeg4-thread.avi
-7e4e2cf2659aa158f5ffed2be45a9c3d *./data/out.yuv
-stddev: 12.31 PSNR:26.31 bytes:7602176
+5da70c628af00fc6d2dba685d24341b6 *./data/a-mpeg4-thread.avi
+764920 ./data/a-mpeg4-thread.avi
+6e3cc8569fd1f39a3657045a8249dbc6 *./data/out.yuv
+stddev: 12.32 PSNR:26.30 bytes:7602176
50867a2530035615152f1e068c989bfc *./data/a-mpeg4-Q.avi
899514 ./data/a-mpeg4-Q.avi
cdb77818e108eab89c9ac4bcaf350e19 *./data/out.yuv
Index: rotozoom.regression.ref
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/tests/rotozoom.regression.ref,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- rotozoom.regression.ref 5 Sep 2005 10:26:11 -0000 1.100
+++ rotozoom.regression.ref 22 Dec 2005 14:17:54 -0000 1.101
@@ -59,18 +59,18 @@
6454196 ./data/a-huffyuv.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
-540bdc49a339db675d12cffc9fce2454 *./data/a-mpeg4-rc.avi
-228094 ./data/a-mpeg4-rc.avi
-764d5da4f1c8eda9bd554179ed1ea283 *./data/out.yuv
+95e95dfe42fce9cdbe72688e821022ca *./data/a-mpeg4-rc.avi
+227834 ./data/a-mpeg4-rc.avi
+2e02fa0261c21268d568ddde74f9431e *./data/out.yuv
stddev: 4.26 PSNR:35.51 bytes:7602176
6844785bcca74b4b9dc77ce6d21a3871 *./data/a-mpeg4-adv.avi
172538 ./data/a-mpeg4-adv.avi
49fecc1105d25ff1c2fc9c0d4cb821b0 *./data/out.yuv
stddev: 4.84 PSNR:34.41 bytes:7602176
-d5f2da1edcf1979d71bec183e461b5aa *./data/a-mpeg4-thread.avi
-253098 ./data/a-mpeg4-thread.avi
-da1a5a3301ad2bdf5806a51ffa74d4fb *./data/out.yuv
-stddev: 4.06 PSNR:35.93 bytes:7602176
+9f7f5a7da720ba720aa35d72ed062959 *./data/a-mpeg4-thread.avi
+253448 ./data/a-mpeg4-thread.avi
+672eff5de3b19df7b82ed3e6bed8642d *./data/out.yuv
+stddev: 4.05 PSNR:35.96 bytes:7602176
ddcb9476113fac71ee609018984353ce *./data/a-mpeg4-Q.avi
165016 ./data/a-mpeg4-Q.avi
94d8bd3897ac20bb3bef9cf384f9abd0 *./data/out.yuv
1
0
CVS: ffmpeg/libavcodec/alpha asm.h, 1.9, 1.10 dsputil_alpha_asm.S, 1.6, 1.7 motion_est_alpha.c, 1.4, 1.5 simple_idct_alpha.c, 1.5, 1.6
by diego@mplayerhq.hu 22 Dec '05
by diego@mplayerhq.hu 22 Dec '05
22 Dec '05
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec/alpha
In directory mail:/var2/tmp/cvs-serv29491/libavcodec/alpha
Modified Files:
asm.h dsputil_alpha_asm.S motion_est_alpha.c
simple_idct_alpha.c
Log Message:
COSMETICS: tabs --> spaces, some prettyprinting
Index: asm.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/alpha/asm.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- asm.h 17 Dec 2005 18:14:32 -0000 1.9
+++ asm.h 22 Dec 2005 01:10:09 -0000 1.10
@@ -84,24 +84,24 @@
} *) (p))->__l) = l; \
} while (0)
struct unaligned_long { uint64_t l; } __attribute__((packed));
-#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
-#define uldq(a) (((const struct unaligned_long *) (a))->l)
+#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
+#define uldq(a) (((const struct unaligned_long *) (a))->l)
#if GNUC_PREREQ(3,3)
#define prefetch(p) __builtin_prefetch((p), 0, 1)
#define prefetch_en(p) __builtin_prefetch((p), 0, 0)
#define prefetch_m(p) __builtin_prefetch((p), 1, 1)
#define prefetch_men(p) __builtin_prefetch((p), 1, 0)
-#define cmpbge __builtin_alpha_cmpbge
+#define cmpbge __builtin_alpha_cmpbge
/* Avoid warnings. */
-#define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
-#define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
-#define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
-#define zap __builtin_alpha_zap
-#define zapnot __builtin_alpha_zapnot
-#define amask __builtin_alpha_amask
-#define implver __builtin_alpha_implver
-#define rpcc __builtin_alpha_rpcc
+#define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
+#define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
+#define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
+#define zap __builtin_alpha_zap
+#define zapnot __builtin_alpha_zapnot
+#define amask __builtin_alpha_amask
+#define implver __builtin_alpha_implver
+#define rpcc __builtin_alpha_rpcc
#else
#define prefetch(p) asm volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
#define prefetch_en(p) asm volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
@@ -113,26 +113,26 @@
#define extqh(a, b) ({ uint64_t __r; asm ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
#define zap(a, b) ({ uint64_t __r; asm ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
#define zapnot(a, b) ({ uint64_t __r; asm ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
-#define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
-#define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
-#define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
+#define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
+#define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
+#define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
#endif
#define wh64(p) asm volatile("wh64 (%0)" : : "r"(p) : "memory")
#if GNUC_PREREQ(3,3) && defined(__alpha_max__)
-#define minub8 __builtin_alpha_minub8
-#define minsb8 __builtin_alpha_minsb8
-#define minuw4 __builtin_alpha_minuw4
-#define minsw4 __builtin_alpha_minsw4
-#define maxub8 __builtin_alpha_maxub8
-#define maxsb8 __builtin_alpha_maxsb8
-#define maxuw4 __builtin_alpha_maxuw4
-#define maxsw4 __builtin_alpha_maxsw4
-#define perr __builtin_alpha_perr
-#define pklb __builtin_alpha_pklb
-#define pkwb __builtin_alpha_pkwb
-#define unpkbl __builtin_alpha_unpkbl
-#define unpkbw __builtin_alpha_unpkbw
+#define minub8 __builtin_alpha_minub8
+#define minsb8 __builtin_alpha_minsb8
+#define minuw4 __builtin_alpha_minuw4
+#define minsw4 __builtin_alpha_minsw4
+#define maxub8 __builtin_alpha_maxub8
+#define maxsb8 __builtin_alpha_maxsb8
+#define maxuw4 __builtin_alpha_maxuw4
+#define maxsw4 __builtin_alpha_maxsw4
+#define perr __builtin_alpha_perr
+#define pklb __builtin_alpha_pklb
+#define pkwb __builtin_alpha_pkwb
+#define unpkbl __builtin_alpha_unpkbl
+#define unpkbw __builtin_alpha_unpkbw
#else
#define minub8(a, b) ({ uint64_t __r; asm (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
#define minsb8(a, b) ({ uint64_t __r; asm (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
@@ -143,13 +143,13 @@
#define maxuw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
#define maxsw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
#define perr(a, b) ({ uint64_t __r; asm (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
-#define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
-#define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
+#define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
+#define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
+#define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
+#define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
#endif
-#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
+#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
#include <c_asm.h>
#define ldq(p) (*(const uint64_t *) (p))
@@ -157,7 +157,7 @@
#define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
#define stl(l, p) do { *(int32_t *) (p) = (l); } while (0)
#define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
-#define uldq(a) (*(const __unaligned uint64_t *) (a))
+#define uldq(a) (*(const __unaligned uint64_t *) (a))
#define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
#define extql(a, b) asm ("extql %a0,%a1,%v0", a, b)
#define extwl(a, b) asm ("extwl %a0,%a1,%v0", a, b)
@@ -166,7 +166,7 @@
#define zapnot(a, b) asm ("zapnot %a0,%a1,%v0", a, b)
#define amask(a) asm ("amask %a0,%v0", a)
#define implver() asm ("implver %v0")
-#define rpcc() asm ("rpcc %v0")
+#define rpcc() asm ("rpcc %v0")
#define minub8(a, b) asm ("minub8 %a0,%a1,%v0", a, b)
#define minsb8(a, b) asm ("minsb8 %a0,%a1,%v0", a, b)
#define minuw4(a, b) asm ("minuw4 %a0,%a1,%v0", a, b)
Index: dsputil_alpha_asm.S
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/alpha/dsputil_alpha_asm.S,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dsputil_alpha_asm.S 17 Dec 2005 18:14:32 -0000 1.6
+++ dsputil_alpha_asm.S 22 Dec 2005 01:10:09 -0000 1.7
@@ -71,7 +71,7 @@
addq a1, a2, a1
nop
- ldq_u t4, 0(a1)
+ ldq_u t4, 0(a1)
ldq_u t5, 8(a1)
addq a1, a2, a1
nop
@@ -120,20 +120,20 @@
addq a1, a2, a1
ldq t3, 0(a1)
- addq a0, a2, t4
- addq a1, a2, a1
- addq t4, a2, t5
- subq a3, 4, a3
+ addq a0, a2, t4
+ addq a1, a2, a1
+ addq t4, a2, t5
+ subq a3, 4, a3
- stq t0, 0(a0)
- addq t5, a2, t6
- stq t1, 0(t4)
- addq t6, a2, a0
+ stq t0, 0(a0)
+ addq t5, a2, t6
+ stq t1, 0(t4)
+ addq t6, a2, a0
- stq t2, 0(t5)
- stq t3, 0(t6)
+ stq t2, 0(t5)
+ stq t3, 0(t6)
- bne a3, $aligned
+ bne a3, $aligned
ret
.end put_pixels_axp_asm
Index: motion_est_alpha.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/alpha/motion_est_alpha.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- motion_est_alpha.c 17 Dec 2005 18:14:32 -0000 1.4
+++ motion_est_alpha.c 22 Dec 2005 01:10:09 -0000 1.5
@@ -116,7 +116,7 @@
return result;
}
-#if 0 /* now done in assembly */
+#if 0 /* now done in assembly */
int pix_abs16x16_mvi(uint8_t *pix1, uint8_t *pix2, int line_size)
{
int result = 0;
Index: simple_idct_alpha.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/alpha/simple_idct_alpha.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- simple_idct_alpha.c 17 Dec 2005 18:14:32 -0000 1.5
+++ simple_idct_alpha.c 22 Dec 2005 01:10:09 -0000 1.6
@@ -285,7 +285,7 @@
stq(v, block + 1 * 4);
stq(w, block + 2 * 4);
stq(w, block + 3 * 4);
- block += 4 * 4;
+ block += 4 * 4;
}
} else {
for (i = 0; i < 8; i++)
1
0
CVS: ffmpeg/libavcodec/armv4l dsputil_arm.c, 1.10, 1.11 dsputil_iwmmxt.c, 1.2, 1.3 jrevdct_arm.S, 1.2, 1.3 simple_idct_arm.S, 1.2, 1.3
by diego@mplayerhq.hu 22 Dec '05
by diego@mplayerhq.hu 22 Dec '05
22 Dec '05
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec/armv4l
In directory mail:/var2/tmp/cvs-serv29491/libavcodec/armv4l
Modified Files:
dsputil_arm.c dsputil_iwmmxt.c jrevdct_arm.S simple_idct_arm.S
Log Message:
COSMETICS: tabs --> spaces, some prettyprinting
Index: dsputil_arm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/armv4l/dsputil_arm.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- dsputil_arm.c 28 Jun 2005 22:46:36 -0000 1.10
+++ dsputil_arm.c 22 Dec 2005 01:10:09 -0000 1.11
@@ -205,13 +205,13 @@
#endif
c->idct_put= j_rev_dct_ARM_put;
c->idct_add= j_rev_dct_ARM_add;
- c->idct = j_rev_dct_ARM;
+ c->idct = j_rev_dct_ARM;
c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
} else if (idct_algo==FF_IDCT_SIMPLEARM){
- c->idct_put= simple_idct_ARM_put;
- c->idct_add= simple_idct_ARM_add;
- c->idct = simple_idct_ARM;
- c->idct_permutation_type= FF_NO_IDCT_PERM;
+ c->idct_put= simple_idct_ARM_put;
+ c->idct_add= simple_idct_ARM_add;
+ c->idct = simple_idct_ARM;
+ c->idct_permutation_type= FF_NO_IDCT_PERM;
#ifdef HAVE_IPP
} else if (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_IPP){
#else
Index: dsputil_iwmmxt.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/armv4l/dsputil_iwmmxt.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dsputil_iwmmxt.c 28 Jun 2005 22:46:36 -0000 1.2
+++ dsputil_iwmmxt.c 22 Dec 2005 01:10:09 -0000 1.3
@@ -138,10 +138,10 @@
mm_flags = mm_support();
if (avctx->dsp_mask) {
- if (avctx->dsp_mask & FF_MM_FORCE)
- mm_flags |= (avctx->dsp_mask & 0xffff);
- else
- mm_flags &= ~(avctx->dsp_mask & 0xffff);
+ if (avctx->dsp_mask & FF_MM_FORCE)
+ mm_flags |= (avctx->dsp_mask & 0xffff);
+ else
+ mm_flags &= ~(avctx->dsp_mask & 0xffff);
}
if (!(mm_flags & MM_IWMMXT)) return;
Index: jrevdct_arm.S
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/armv4l/jrevdct_arm.S,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- jrevdct_arm.S 17 Dec 2005 18:14:32 -0000 1.2
+++ jrevdct_arm.S 22 Dec 2005 01:10:09 -0000 1.3
@@ -1,6 +1,6 @@
/*
C-like prototype :
- void j_rev_dct_ARM(DCTBLOCK data)
+ void j_rev_dct_ARM(DCTBLOCK data)
With DCTBLOCK being a pointer to an array of 64 'signed shorts'
@@ -51,336 +51,336 @@
#define FIX_M_1_961570560_ID 40
#define FIX_M_2_562915447_ID 44
#define FIX_0xFFFF_ID 48
- .text
- .align
+ .text
+ .align
- .global j_rev_dct_ARM
+ .global j_rev_dct_ARM
j_rev_dct_ARM:
- stmdb sp!, { r4 - r12, lr } @ all callee saved regs
+ stmdb sp!, { r4 - r12, lr } @ all callee saved regs
- sub sp, sp, #4 @ reserve some space on the stack
- str r0, [ sp ] @ save the DCT pointer to the stack
+ sub sp, sp, #4 @ reserve some space on the stack
+ str r0, [ sp ] @ save the DCT pointer to the stack
- mov lr, r0 @ lr = pointer to the current row
- mov r12, #8 @ r12 = row-counter
- add r11, pc, #(const_array-.-8) @ r11 = base pointer to the constants array
+ mov lr, r0 @ lr = pointer to the current row
+ mov r12, #8 @ r12 = row-counter
+ add r11, pc, #(const_array-.-8) @ r11 = base pointer to the constants array
row_loop:
- ldrsh r0, [lr, # 0] @ r0 = 'd0'
- ldrsh r1, [lr, # 8] @ r1 = 'd1'
+ ldrsh r0, [lr, # 0] @ r0 = 'd0'
+ ldrsh r1, [lr, # 8] @ r1 = 'd1'
- @ Optimization for row that have all items except the first set to 0
- @ (this works as the DCTELEMS are always 4-byte aligned)
- ldr r5, [lr, # 0]
- ldr r2, [lr, # 4]
- ldr r3, [lr, # 8]
- ldr r4, [lr, #12]
- orr r3, r3, r4
- orr r3, r3, r2
- orrs r5, r3, r5
- beq end_of_row_loop @ nothing to be done as ALL of them are '0'
- orrs r2, r3, r1
- beq empty_row
+ @ Optimization for row that have all items except the first set to 0
+ @ (this works as the DCTELEMS are always 4-byte aligned)
+ ldr r5, [lr, # 0]
+ ldr r2, [lr, # 4]
+ ldr r3, [lr, # 8]
+ ldr r4, [lr, #12]
+ orr r3, r3, r4
+ orr r3, r3, r2
+ orrs r5, r3, r5
+ beq end_of_row_loop @ nothing to be done as ALL of them are '0'
+ orrs r2, r3, r1
+ beq empty_row
- ldrsh r2, [lr, # 2] @ r2 = 'd2'
- ldrsh r4, [lr, # 4] @ r4 = 'd4'
- ldrsh r6, [lr, # 6] @ r6 = 'd6'
+ ldrsh r2, [lr, # 2] @ r2 = 'd2'
+ ldrsh r4, [lr, # 4] @ r4 = 'd4'
+ ldrsh r6, [lr, # 6] @ r6 = 'd6'
- ldr r3, [r11, #FIX_0_541196100_ID]
- add r7, r2, r6
- ldr r5, [r11, #FIX_M_1_847759065_ID]
- mul r7, r3, r7 @ r7 = z1
- ldr r3, [r11, #FIX_0_765366865_ID]
- mla r6, r5, r6, r7 @ r6 = tmp2
- add r5, r0, r4 @ r5 = tmp0
- mla r2, r3, r2, r7 @ r2 = tmp3
- sub r3, r0, r4 @ r3 = tmp1
+ ldr r3, [r11, #FIX_0_541196100_ID]
+ add r7, r2, r6
+ ldr r5, [r11, #FIX_M_1_847759065_ID]
+ mul r7, r3, r7 @ r7 = z1
+ ldr r3, [r11, #FIX_0_765366865_ID]
+ mla r6, r5, r6, r7 @ r6 = tmp2
+ add r5, r0, r4 @ r5 = tmp0
+ mla r2, r3, r2, r7 @ r2 = tmp3
+ sub r3, r0, r4 @ r3 = tmp1
- add r0, r2, r5, lsl #13 @ r0 = tmp10
- rsb r2, r2, r5, lsl #13 @ r2 = tmp13
- add r4, r6, r3, lsl #13 @ r4 = tmp11
- rsb r3, r6, r3, lsl #13 @ r3 = tmp12
+ add r0, r2, r5, lsl #13 @ r0 = tmp10
+ rsb r2, r2, r5, lsl #13 @ r2 = tmp13
+ add r4, r6, r3, lsl #13 @ r4 = tmp11
+ rsb r3, r6, r3, lsl #13 @ r3 = tmp12
- stmdb sp!, { r0, r2, r3, r4 } @ save on the stack tmp10, tmp13, tmp12, tmp11
+ stmdb sp!, { r0, r2, r3, r4 } @ save on the stack tmp10, tmp13, tmp12, tmp11
- ldrsh r3, [lr, #10] @ r3 = 'd3'
- ldrsh r5, [lr, #12] @ r5 = 'd5'
- ldrsh r7, [lr, #14] @ r7 = 'd7'
+ ldrsh r3, [lr, #10] @ r3 = 'd3'
+ ldrsh r5, [lr, #12] @ r5 = 'd5'
+ ldrsh r7, [lr, #14] @ r7 = 'd7'
- add r0, r3, r5 @ r0 = 'z2'
- add r2, r1, r7 @ r2 = 'z1'
- add r4, r3, r7 @ r4 = 'z3'
- add r6, r1, r5 @ r6 = 'z4'
- ldr r9, [r11, #FIX_1_175875602_ID]
- add r8, r4, r6 @ r8 = z3 + z4
- ldr r10, [r11, #FIX_M_0_899976223_ID]
- mul r8, r9, r8 @ r8 = 'z5'
- ldr r9, [r11, #FIX_M_2_562915447_ID]
- mul r2, r10, r2 @ r2 = 'z1'
- ldr r10, [r11, #FIX_M_1_961570560_ID]
- mul r0, r9, r0 @ r0 = 'z2'
- ldr r9, [r11, #FIX_M_0_390180644_ID]
- mla r4, r10, r4, r8 @ r4 = 'z3'
- ldr r10, [r11, #FIX_0_298631336_ID]
- mla r6, r9, r6, r8 @ r6 = 'z4'
- ldr r9, [r11, #FIX_2_053119869_ID]
- mla r7, r10, r7, r2 @ r7 = tmp0 + z1
- ldr r10, [r11, #FIX_3_072711026_ID]
- mla r5, r9, r5, r0 @ r5 = tmp1 + z2
- ldr r9, [r11, #FIX_1_501321110_ID]
- mla r3, r10, r3, r0 @ r3 = tmp2 + z2
- add r7, r7, r4 @ r7 = tmp0
- mla r1, r9, r1, r2 @ r1 = tmp3 + z1
- add r5, r5, r6 @ r5 = tmp1
- add r3, r3, r4 @ r3 = tmp2
- add r1, r1, r6 @ r1 = tmp3
+ add r0, r3, r5 @ r0 = 'z2'
+ add r2, r1, r7 @ r2 = 'z1'
+ add r4, r3, r7 @ r4 = 'z3'
+ add r6, r1, r5 @ r6 = 'z4'
+ ldr r9, [r11, #FIX_1_175875602_ID]
+ add r8, r4, r6 @ r8 = z3 + z4
+ ldr r10, [r11, #FIX_M_0_899976223_ID]
+ mul r8, r9, r8 @ r8 = 'z5'
+ ldr r9, [r11, #FIX_M_2_562915447_ID]
+ mul r2, r10, r2 @ r2 = 'z1'
+ ldr r10, [r11, #FIX_M_1_961570560_ID]
+ mul r0, r9, r0 @ r0 = 'z2'
+ ldr r9, [r11, #FIX_M_0_390180644_ID]
+ mla r4, r10, r4, r8 @ r4 = 'z3'
+ ldr r10, [r11, #FIX_0_298631336_ID]
+ mla r6, r9, r6, r8 @ r6 = 'z4'
+ ldr r9, [r11, #FIX_2_053119869_ID]
+ mla r7, r10, r7, r2 @ r7 = tmp0 + z1
+ ldr r10, [r11, #FIX_3_072711026_ID]
+ mla r5, r9, r5, r0 @ r5 = tmp1 + z2
+ ldr r9, [r11, #FIX_1_501321110_ID]
+ mla r3, r10, r3, r0 @ r3 = tmp2 + z2
+ add r7, r7, r4 @ r7 = tmp0
+ mla r1, r9, r1, r2 @ r1 = tmp3 + z1
+ add r5, r5, r6 @ r5 = tmp1
+ add r3, r3, r4 @ r3 = tmp2
+ add r1, r1, r6 @ r1 = tmp3
- ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp12 / r6 = tmp11
- @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
+ ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp12 / r6 = tmp11
+ @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
- @ Compute DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS)
- add r8, r0, r1
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 0]
+ @ Compute DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS)
+ add r8, r0, r1
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, # 0]
- @ Compute DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS)
- sub r8, r0, r1
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, #14]
+ @ Compute DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS)
+ sub r8, r0, r1
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, #14]
- @ Compute DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS)
- add r8, r6, r3
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 2]
+ @ Compute DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS)
+ add r8, r6, r3
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, # 2]
- @ Compute DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS)
- sub r8, r6, r3
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, #12]
+ @ Compute DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS)
+ sub r8, r6, r3
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, #12]
- @ Compute DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS)
- add r8, r4, r5
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 4]
+ @ Compute DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS)
+ add r8, r4, r5
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, # 4]
- @ Compute DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS)
- sub r8, r4, r5
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, #10]
+ @ Compute DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS)
+ sub r8, r4, r5
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, #10]
- @ Compute DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS)
- add r8, r2, r7
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 6]
+ @ Compute DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS)
+ add r8, r2, r7
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, # 6]
- @ Compute DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS)
- sub r8, r2, r7
- add r8, r8, #(1<<10)
- mov r8, r8, asr #11
- strh r8, [lr, # 8]
+ @ Compute DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS)
+ sub r8, r2, r7
+ add r8, r8, #(1<<10)
+ mov r8, r8, asr #11
+ strh r8, [lr, # 8]
- @ End of row loop
- add lr, lr, #16
- subs r12, r12, #1
- bne row_loop
- beq start_column_loop
+ @ End of row loop
+ add lr, lr, #16
+ subs r12, r12, #1
+ bne row_loop
+ beq start_column_loop
empty_row:
- ldr r1, [r11, #FIX_0xFFFF_ID]
- mov r0, r0, lsl #2
- and r0, r0, r1
- add r0, r0, r0, lsl #16
- str r0, [lr, # 0]
- str r0, [lr, # 4]
- str r0, [lr, # 8]
- str r0, [lr, #12]
+ ldr r1, [r11, #FIX_0xFFFF_ID]
+ mov r0, r0, lsl #2
+ and r0, r0, r1
+ add r0, r0, r0, lsl #16
+ str r0, [lr, # 0]
+ str r0, [lr, # 4]
+ str r0, [lr, # 8]
+ str r0, [lr, #12]
end_of_row_loop:
- @ End of loop
- add lr, lr, #16
- subs r12, r12, #1
- bne row_loop
+ @ End of loop
+ add lr, lr, #16
+ subs r12, r12, #1
+ bne row_loop
start_column_loop:
- @ Start of column loop
- ldr lr, [ sp ]
- mov r12, #8
+ @ Start of column loop
+ ldr lr, [ sp ]
+ mov r12, #8
column_loop:
- ldrsh r0, [lr, #( 0*8)] @ r0 = 'd0'
- ldrsh r2, [lr, #( 4*8)] @ r2 = 'd2'
- ldrsh r4, [lr, #( 8*8)] @ r4 = 'd4'
- ldrsh r6, [lr, #(12*8)] @ r6 = 'd6'
+ ldrsh r0, [lr, #( 0*8)] @ r0 = 'd0'
+ ldrsh r2, [lr, #( 4*8)] @ r2 = 'd2'
+ ldrsh r4, [lr, #( 8*8)] @ r4 = 'd4'
+ ldrsh r6, [lr, #(12*8)] @ r6 = 'd6'
- ldr r3, [r11, #FIX_0_541196100_ID]
- add r1, r2, r6
- ldr r5, [r11, #FIX_M_1_847759065_ID]
- mul r1, r3, r1 @ r1 = z1
- ldr r3, [r11, #FIX_0_765366865_ID]
- mla r6, r5, r6, r1 @ r6 = tmp2
- add r5, r0, r4 @ r5 = tmp0
- mla r2, r3, r2, r1 @ r2 = tmp3
- sub r3, r0, r4 @ r3 = tmp1
+ ldr r3, [r11, #FIX_0_541196100_ID]
+ add r1, r2, r6
+ ldr r5, [r11, #FIX_M_1_847759065_ID]
+ mul r1, r3, r1 @ r1 = z1
+ ldr r3, [r11, #FIX_0_765366865_ID]
+ mla r6, r5, r6, r1 @ r6 = tmp2
+ add r5, r0, r4 @ r5 = tmp0
+ mla r2, r3, r2, r1 @ r2 = tmp3
+ sub r3, r0, r4 @ r3 = tmp1
- add r0, r2, r5, lsl #13 @ r0 = tmp10
- rsb r2, r2, r5, lsl #13 @ r2 = tmp13
- add r4, r6, r3, lsl #13 @ r4 = tmp11
- rsb r6, r6, r3, lsl #13 @ r6 = tmp12
+ add r0, r2, r5, lsl #13 @ r0 = tmp10
+ rsb r2, r2, r5, lsl #13 @ r2 = tmp13
+ add r4, r6, r3, lsl #13 @ r4 = tmp11
+ rsb r6, r6, r3, lsl #13 @ r6 = tmp12
- ldrsh r1, [lr, #( 2*8)] @ r1 = 'd1'
- ldrsh r3, [lr, #( 6*8)] @ r3 = 'd3'
- ldrsh r5, [lr, #(10*8)] @ r5 = 'd5'
- ldrsh r7, [lr, #(14*8)] @ r7 = 'd7'
+ ldrsh r1, [lr, #( 2*8)] @ r1 = 'd1'
+ ldrsh r3, [lr, #( 6*8)] @ r3 = 'd3'
+ ldrsh r5, [lr, #(10*8)] @ r5 = 'd5'
+ ldrsh r7, [lr, #(14*8)] @ r7 = 'd7'
- @ Check for empty odd column (happens about 20 to 25 % of the time according to my stats)
- orr r9, r1, r3
- orr r10, r5, r7
- orrs r10, r9, r10
- beq empty_odd_column
+ @ Check for empty odd column (happens about 20 to 25 % of the time according to my stats)
+ orr r9, r1, r3
+ orr r10, r5, r7
+ orrs r10, r9, r10
+ beq empty_odd_column
- stmdb sp!, { r0, r2, r4, r6 } @ save on the stack tmp10, tmp13, tmp12, tmp11
+ stmdb sp!, { r0, r2, r4, r6 } @ save on the stack tmp10, tmp13, tmp12, tmp11
- add r0, r3, r5 @ r0 = 'z2'
- add r2, r1, r7 @ r2 = 'z1'
- add r4, r3, r7 @ r4 = 'z3'
- add r6, r1, r5 @ r6 = 'z4'
- ldr r9, [r11, #FIX_1_175875602_ID]
- add r8, r4, r6
- ldr r10, [r11, #FIX_M_0_899976223_ID]
- mul r8, r9, r8 @ r8 = 'z5'
- ldr r9, [r11, #FIX_M_2_562915447_ID]
- mul r2, r10, r2 @ r2 = 'z1'
- ldr r10, [r11, #FIX_M_1_961570560_ID]
- mul r0, r9, r0 @ r0 = 'z2'
- ldr r9, [r11, #FIX_M_0_390180644_ID]
- mla r4, r10, r4, r8 @ r4 = 'z3'
- ldr r10, [r11, #FIX_0_298631336_ID]
- mla r6, r9, r6, r8 @ r6 = 'z4'
- ldr r9, [r11, #FIX_2_053119869_ID]
- mla r7, r10, r7, r2 @ r7 = tmp0 + z1
- ldr r10, [r11, #FIX_3_072711026_ID]
- mla r5, r9, r5, r0 @ r5 = tmp1 + z2
- ldr r9, [r11, #FIX_1_501321110_ID]
- mla r3, r10, r3, r0 @ r3 = tmp2 + z2
- add r7, r7, r4 @ r7 = tmp0
- mla r1, r9, r1, r2 @ r1 = tmp3 + z1
- add r5, r5, r6 @ r5 = tmp1
- add r3, r3, r4 @ r3 = tmp2
- add r1, r1, r6 @ r1 = tmp3
+ add r0, r3, r5 @ r0 = 'z2'
+ add r2, r1, r7 @ r2 = 'z1'
+ add r4, r3, r7 @ r4 = 'z3'
+ add r6, r1, r5 @ r6 = 'z4'
+ ldr r9, [r11, #FIX_1_175875602_ID]
+ add r8, r4, r6
+ ldr r10, [r11, #FIX_M_0_899976223_ID]
+ mul r8, r9, r8 @ r8 = 'z5'
+ ldr r9, [r11, #FIX_M_2_562915447_ID]
+ mul r2, r10, r2 @ r2 = 'z1'
+ ldr r10, [r11, #FIX_M_1_961570560_ID]
+ mul r0, r9, r0 @ r0 = 'z2'
+ ldr r9, [r11, #FIX_M_0_390180644_ID]
+ mla r4, r10, r4, r8 @ r4 = 'z3'
+ ldr r10, [r11, #FIX_0_298631336_ID]
+ mla r6, r9, r6, r8 @ r6 = 'z4'
+ ldr r9, [r11, #FIX_2_053119869_ID]
+ mla r7, r10, r7, r2 @ r7 = tmp0 + z1
+ ldr r10, [r11, #FIX_3_072711026_ID]
+ mla r5, r9, r5, r0 @ r5 = tmp1 + z2
+ ldr r9, [r11, #FIX_1_501321110_ID]
+ mla r3, r10, r3, r0 @ r3 = tmp2 + z2
+ add r7, r7, r4 @ r7 = tmp0
+ mla r1, r9, r1, r2 @ r1 = tmp3 + z1
+ add r5, r5, r6 @ r5 = tmp1
+ add r3, r3, r4 @ r3 = tmp2
+ add r1, r1, r6 @ r1 = tmp3
- ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp11 / r6 = tmp12
- @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
+ ldmia sp!, { r0, r2, r4, r6 } @ r0 = tmp10 / r2 = tmp13 / r4 = tmp11 / r6 = tmp12
+ @ r1 = tmp3 / r3 = tmp2 / r5 = tmp1 / r7 = tmp0
- @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
- add r8, r0, r1
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 0*8)]
+ @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
+ add r8, r0, r1
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #( 0*8)]
- @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
- sub r8, r0, r1
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #(14*8)]
+ @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
+ sub r8, r0, r1
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #(14*8)]
- @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
- add r8, r4, r3
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 2*8)]
+ @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
+ add r8, r4, r3
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #( 2*8)]
- @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
- sub r8, r4, r3
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #(12*8)]
+ @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
+ sub r8, r4, r3
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #(12*8)]
- @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
- add r8, r6, r5
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 4*8)]
+ @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
+ add r8, r6, r5
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #( 4*8)]
- @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
- sub r8, r6, r5
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #(10*8)]
+ @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
+ sub r8, r6, r5
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #(10*8)]
- @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
- add r8, r2, r7
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 6*8)]
+ @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
+ add r8, r2, r7
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #( 6*8)]
- @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
- sub r8, r2, r7
- add r8, r8, #(1<<17)
- mov r8, r8, asr #18
- strh r8, [lr, #( 8*8)]
+ @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
+ sub r8, r2, r7
+ add r8, r8, #(1<<17)
+ mov r8, r8, asr #18
+ strh r8, [lr, #( 8*8)]
- @ End of row loop
- add lr, lr, #2
- subs r12, r12, #1
- bne column_loop
- beq the_end
+ @ End of row loop
+ add lr, lr, #2
+ subs r12, r12, #1
+ bne column_loop
+ beq the_end
empty_odd_column:
- @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
- add r0, r0, #(1<<17)
- mov r0, r0, asr #18
- strh r0, [lr, #( 0*8)]
- strh r0, [lr, #(14*8)]
+ @ Compute DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3)
+ @ Compute DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3)
+ add r0, r0, #(1<<17)
+ mov r0, r0, asr #18
+ strh r0, [lr, #( 0*8)]
+ strh r0, [lr, #(14*8)]
- @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
- add r4, r4, #(1<<17)
- mov r4, r4, asr #18
- strh r4, [lr, #( 2*8)]
- strh r4, [lr, #(12*8)]
+ @ Compute DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3)
+ @ Compute DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3)
+ add r4, r4, #(1<<17)
+ mov r4, r4, asr #18
+ strh r4, [lr, #( 2*8)]
+ strh r4, [lr, #(12*8)]
- @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
- add r6, r6, #(1<<17)
- mov r6, r6, asr #18
- strh r6, [lr, #( 4*8)]
- strh r6, [lr, #(10*8)]
+ @ Compute DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3)
+ @ Compute DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3)
+ add r6, r6, #(1<<17)
+ mov r6, r6, asr #18
+ strh r6, [lr, #( 4*8)]
+ strh r6, [lr, #(10*8)]
- @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
- @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
- add r2, r2, #(1<<17)
- mov r2, r2, asr #18
- strh r2, [lr, #( 6*8)]
- strh r2, [lr, #( 8*8)]
+ @ Compute DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3)
+ @ Compute DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3)
+ add r2, r2, #(1<<17)
+ mov r2, r2, asr #18
+ strh r2, [lr, #( 6*8)]
+ strh r2, [lr, #( 8*8)]
- @ End of row loop
- add lr, lr, #2
- subs r12, r12, #1
- bne column_loop
+ @ End of row loop
+ add lr, lr, #2
+ subs r12, r12, #1
+ bne column_loop
the_end:
- @ The end....
- add sp, sp, #4
- ldmia sp!, { r4 - r12, pc } @ restore callee saved regs and return
+ @ The end....
+ add sp, sp, #4
+ ldmia sp!, { r4 - r12, pc } @ restore callee saved regs and return
const_array:
- .align
- .word FIX_0_298631336
- .word FIX_0_541196100
- .word FIX_0_765366865
- .word FIX_1_175875602
- .word FIX_1_501321110
- .word FIX_2_053119869
- .word FIX_3_072711026
- .word FIX_M_0_390180644
- .word FIX_M_0_899976223
- .word FIX_M_1_847759065
- .word FIX_M_1_961570560
- .word FIX_M_2_562915447
- .word FIX_0xFFFF
+ .align
+ .word FIX_0_298631336
+ .word FIX_0_541196100
+ .word FIX_0_765366865
+ .word FIX_1_175875602
+ .word FIX_1_501321110
+ .word FIX_2_053119869
+ .word FIX_3_072711026
+ .word FIX_M_0_390180644
+ .word FIX_M_0_899976223
+ .word FIX_M_1_847759065
+ .word FIX_M_1_961570560
+ .word FIX_M_2_562915447
+ .word FIX_0xFFFF
Index: simple_idct_arm.S
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/armv4l/simple_idct_arm.S,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- simple_idct_arm.S 17 Dec 2005 18:14:32 -0000 1.2
+++ simple_idct_arm.S 22 Dec 2005 01:10:09 -0000 1.3
@@ -51,9 +51,9 @@
#define COL_SHIFTED_1 524288 /* 1<< (COL_SHIFT-1) */
- .text
- .align
- .global simple_idct_ARM
+ .text
+ .align
+ .global simple_idct_ARM
simple_idct_ARM:
@@ void simple_idct_ARM(int16_t *block)
@@ -120,8 +120,8 @@
ldr r11, [r12, #offW7] @ R11=W7
mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- teq r2, #0 @ if null avoid muls
- mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
+ teq r2, #0 @ if null avoid muls
+ mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
rsbne r2, r2, #0 @ R2=-ROWr16[3]
mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
@@ -147,7 +147,7 @@
@@ MAC16(b3, -W1, row[7]);
@@ MAC16(b1, -W5, row[7]);
mov r3, r3, asr #16 @ R3=ROWr16[5]
- teq r3, #0 @ if null avoid muls
+ teq r3, #0 @ if null avoid muls
mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5]=b0
mov r4, r4, asr #16 @ R4=ROWr16[7]
mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5]=b2
@@ -155,7 +155,7 @@
rsbne r3, r3, #0 @ R3=-ROWr16[5]
mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5]=b1
@@ R3 is free now
- teq r4, #0 @ if null avoid muls
+ teq r4, #0 @ if null avoid muls
mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7]=b0
mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7]=b2
rsbne r4, r4, #0 @ R4=-ROWr16[7]
@@ -187,7 +187,7 @@
teq r2, #0
beq __end_bef_a_evaluation
- add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
+ add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
mul r11, r8, r4 @ R11=W2*ROWr16[2]
sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
@@ -203,7 +203,7 @@
@@ a2 -= W4*row[4]
@@ a3 += W4*row[4]
ldrsh r11, [r14, #8] @ R11=ROWr16[4]
- teq r11, #0 @ if null avoid muls
+ teq r11, #0 @ if null avoid muls
mulne r11, r9, r11 @ R11=W4*ROWr16[4]
@@ R9 is free now
ldrsh r9, [r14, #12] @ R9=ROWr16[6]
@@ -212,7 +212,7 @@
subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
@@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
- teq r9, #0 @ if null avoid muls
+ teq r9, #0 @ if null avoid muls
mulne r11, r10, r9 @ R11=W6*ROWr16[6]
addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
mulne r10, r8, r9 @ R10=W2*ROWr16[6]
@@ -294,165 +294,165 @@
- @@ at this point, R0=block, R1-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- add r14, r0, #14 @ R14=&block[7], better start from the last col, and decrease the value until col=0, i.e. R14=block.
+ @@ at this point, R0=block, R1-R11 (free)
+ @@ R12=__const_ptr_, R14=&block[n]
+ add r14, r0, #14 @ R14=&block[7], better start from the last col, and decrease the value until col=0, i.e. R14=block.
__col_loop:
__b_evaluation2:
- @@ at this point, R0=block (temp), R1-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- @@ proceed with b0-b3 first, followed by a0-a3
- @@ MUL16(b0, W1, col[8x1]);
- @@ MUL16(b1, W3, col[8x1]);
- @@ MUL16(b2, W5, col[8x1]);
- @@ MUL16(b3, W7, col[8x1]);
- @@ MAC16(b0, W3, col[8x3]);
- @@ MAC16(b1, -W7, col[8x3]);
- @@ MAC16(b2, -W1, col[8x3]);
- @@ MAC16(b3, -W5, col[8x3]);
- ldr r8, [r12, #offW1] @ R8=W1
- ldrsh r7, [r14, #16]
- mul r0, r8, r7 @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldr r9, [r12, #offW3] @ R9=W3
- ldr r10, [r12, #offW5] @ R10=W5
- mul r1, r9, r7 @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldr r11, [r12, #offW7] @ R11=W7
- mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- ldrsh r2, [r14, #48]
- mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
- teq r2, #0 @ if 0, then avoid muls
- mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- rsbne r2, r2, #0 @ R2=-ROWr16[3]
- mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- mlane r7, r10, r2, r7 @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
+ @@ at this point, R0=block (temp), R1-R11 (free)
+ @@ R12=__const_ptr_, R14=&block[n]
+ @@ proceed with b0-b3 first, followed by a0-a3
+ @@ MUL16(b0, W1, col[8x1]);
+ @@ MUL16(b1, W3, col[8x1]);
+ @@ MUL16(b2, W5, col[8x1]);
+ @@ MUL16(b3, W7, col[8x1]);
+ @@ MAC16(b0, W3, col[8x3]);
+ @@ MAC16(b1, -W7, col[8x3]);
+ @@ MAC16(b2, -W1, col[8x3]);
+ @@ MAC16(b3, -W5, col[8x3]);
+ ldr r8, [r12, #offW1] @ R8=W1
+ ldrsh r7, [r14, #16]
+ mul r0, r8, r7 @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
+ ldr r9, [r12, #offW3] @ R9=W3
+ ldr r10, [r12, #offW5] @ R10=W5
+ mul r1, r9, r7 @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
+ ldr r11, [r12, #offW7] @ R11=W7
+ mul r5, r10, r7 @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
+ ldrsh r2, [r14, #48]
+ mul r7, r11, r7 @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
+ teq r2, #0 @ if 0, then avoid muls
+ mlane r0, r9, r2, r0 @ R0+=W3*ROWr16[3]=b0 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
+ rsbne r2, r2, #0 @ R2=-ROWr16[3]
+ mlane r1, r11, r2, r1 @ R1-=W7*ROWr16[3]=b1 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
+ mlane r5, r8, r2, r5 @ R5-=W1*ROWr16[3]=b2 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
+ mlane r7, r10, r2, r7 @ R7-=W5*ROWr16[3]=b3 (ROWr16[3] must be the second arg, to have the possibility to save 1 cycle)
- @@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
- @@ R5=b2, R6 (free), R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
- @@ R12=__const_ptr_, R14=&block[n]
- @@ MAC16(b0, W5, col[5x8]);
- @@ MAC16(b2, W7, col[5x8]);
- @@ MAC16(b3, W3, col[5x8]);
- @@ MAC16(b1, -W1, col[5x8]);
- @@ MAC16(b0, W7, col[7x8]);
- @@ MAC16(b2, W3, col[7x8]);
- @@ MAC16(b3, -W1, col[7x8]);
- @@ MAC16(b1, -W5, col[7x8]);
- ldrsh r3, [r14, #80] @ R3=COLr16[5x8]
- teq r3, #0 @ if 0 then avoid muls
- mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5x8]=b0
- mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5x8]=b2
- mlane r7, r9, r3, r7 @ R7+=W3*ROWr16[5x8]=b3
- rsbne r3, r3, #0 @ R3=-ROWr16[5x8]
- ldrsh r4, [r14, #112] @ R4=COLr16[7x8]
- mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5x8]=b1
- @@ R3 is free now
- teq r4, #0 @ if 0 then avoid muls
- mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7x8]=b0
- mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7x8]=b2
- rsbne r4, r4, #0 @ R4=-ROWr16[7x8]
- mlane r7, r8, r4, r7 @ R7-=W1*ROWr16[7x8]=b3
- mlane r1, r10, r4, r1 @ R1-=W5*ROWr16[7x8]=b1
- @@ R4 is free now
+ @@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
+ @@ R5=b2, R6 (free), R7=b3, R8=W1, R9=W3, R10=W5, R11=W7,
+ @@ R12=__const_ptr_, R14=&block[n]
+ @@ MAC16(b0, W5, col[5x8]);
+ @@ MAC16(b2, W7, col[5x8]);
+ @@ MAC16(b3, W3, col[5x8]);
+ @@ MAC16(b1, -W1, col[5x8]);
+ @@ MAC16(b0, W7, col[7x8]);
+ @@ MAC16(b2, W3, col[7x8]);
+ @@ MAC16(b3, -W1, col[7x8]);
+ @@ MAC16(b1, -W5, col[7x8]);
+ ldrsh r3, [r14, #80] @ R3=COLr16[5x8]
+ teq r3, #0 @ if 0 then avoid muls
+ mlane r0, r10, r3, r0 @ R0+=W5*ROWr16[5x8]=b0
+ mlane r5, r11, r3, r5 @ R5+=W7*ROWr16[5x8]=b2
+ mlane r7, r9, r3, r7 @ R7+=W3*ROWr16[5x8]=b3
+ rsbne r3, r3, #0 @ R3=-ROWr16[5x8]
+ ldrsh r4, [r14, #112] @ R4=COLr16[7x8]
+ mlane r1, r8, r3, r1 @ R7-=W1*ROWr16[5x8]=b1
+ @@ R3 is free now
+ teq r4, #0 @ if 0 then avoid muls
+ mlane r0, r11, r4, r0 @ R0+=W7*ROWr16[7x8]=b0
+ mlane r5, r9, r4, r5 @ R5+=W3*ROWr16[7x8]=b2
+ rsbne r4, r4, #0 @ R4=-ROWr16[7x8]
+ mlane r7, r8, r4, r7 @ R7-=W1*ROWr16[7x8]=b3
+ mlane r1, r10, r4, r1 @ R1-=W5*ROWr16[7x8]=b1
+ @@ R4 is free now
__end_b_evaluation2:
- @@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
- @@ R5=b2, R6 (free), R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
+ @@ at this point, R0=b0, R1=b1, R2 (free), R3 (free), R4 (free),
+ @@ R5=b2, R6 (free), R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
+ @@ R12=__const_ptr_, R14=&block[n]
__a_evaluation2:
- @@ a0 = (W4 * col[8x0]) + (1 << (COL_SHIFT - 1));
- @@ a1 = a0 + W6 * row[2];
- @@ a2 = a0 - W6 * row[2];
- @@ a3 = a0 - W2 * row[2];
- @@ a0 = a0 + W2 * row[2];
- ldrsh r6, [r14, #0]
- ldr r9, [r12, #offW4] @ R9=W4
- mul r6, r9, r6 @ R6=W4*ROWr16[0]
- ldr r10, [r12, #offW6] @ R10=W6
- ldrsh r4, [r14, #32] @ R4=ROWr16[2] (a3 not defined yet)
- add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
- mul r11, r10, r4 @ R11=W6*ROWr16[2]
- ldr r8, [r12, #offW2] @ R8=W2
- add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
- sub r3, r6, r11 @ R3=a0-W6*ROWr16[2] (a2)
- mul r11, r8, r4 @ R11=W2*ROWr16[2]
- sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
- add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
+ @@ a0 = (W4 * col[8x0]) + (1 << (COL_SHIFT - 1));
+ @@ a1 = a0 + W6 * row[2];
+ @@ a2 = a0 - W6 * row[2];
+ @@ a3 = a0 - W2 * row[2];
+ @@ a0 = a0 + W2 * row[2];
+ ldrsh r6, [r14, #0]
+ ldr r9, [r12, #offW4] @ R9=W4
+ mul r6, r9, r6 @ R6=W4*ROWr16[0]
+ ldr r10, [r12, #offW6] @ R10=W6
+ ldrsh r4, [r14, #32] @ R4=ROWr16[2] (a3 not defined yet)
+ add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
+ mul r11, r10, r4 @ R11=W6*ROWr16[2]
+ ldr r8, [r12, #offW2] @ R8=W2
+ add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
+ sub r3, r6, r11 @ R3=a0-W6*ROWr16[2] (a2)
+ mul r11, r8, r4 @ R11=W2*ROWr16[2]
+ sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
+ add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
- @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
- @@ R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
- @@ a0 += W4*row[4]
- @@ a1 -= W4*row[4]
- @@ a2 -= W4*row[4]
- @@ a3 += W4*row[4]
- ldrsh r11, [r14, #64] @ R11=ROWr16[4]
- teq r11, #0 @ if null avoid muls
- mulne r11, r9, r11 @ R11=W4*ROWr16[4]
- @@ R9 is free now
- addne r6, r6, r11 @ R6+=W4*ROWr16[4] (a0)
- subne r2, r2, r11 @ R2-=W4*ROWr16[4] (a1)
- subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
- ldrsh r9, [r14, #96] @ R9=ROWr16[6]
- addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
- @@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
- teq r9, #0 @ if null avoid muls
- mulne r11, r10, r9 @ R11=W6*ROWr16[6]
- addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
- mulne r10, r8, r9 @ R10=W2*ROWr16[6]
- @@ a0 += W6*row[6];
- @@ a3 -= W6*row[6];
- @@ a1 -= W2*row[6];
- @@ a2 += W2*row[6];
- subne r4, r4, r11 @ R4-=W6*ROWr16[6] (a3)
- subne r2, r2, r10 @ R2-=W2*ROWr16[6] (a1)
- addne r3, r3, r10 @ R3+=W2*ROWr16[6] (a2)
+ @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
+ @@ R5=b2, R6=a0, R7=b3, R8=W2, R9=W4, R10=W6, R11 (free),
+ @@ R12=__const_ptr_, R14=&block[n]
+ @@ a0 += W4*row[4]
+ @@ a1 -= W4*row[4]
+ @@ a2 -= W4*row[4]
+ @@ a3 += W4*row[4]
+ ldrsh r11, [r14, #64] @ R11=ROWr16[4]
+ teq r11, #0 @ if null avoid muls
+ mulne r11, r9, r11 @ R11=W4*ROWr16[4]
+ @@ R9 is free now
+ addne r6, r6, r11 @ R6+=W4*ROWr16[4] (a0)
+ subne r2, r2, r11 @ R2-=W4*ROWr16[4] (a1)
+ subne r3, r3, r11 @ R3-=W4*ROWr16[4] (a2)
+ ldrsh r9, [r14, #96] @ R9=ROWr16[6]
+ addne r4, r4, r11 @ R4+=W4*ROWr16[4] (a3)
+ @@ W6 alone is no more useful, save W2*ROWr16[6] in it instead
+ teq r9, #0 @ if null avoid muls
+ mulne r11, r10, r9 @ R11=W6*ROWr16[6]
+ addne r6, r6, r11 @ R6+=W6*ROWr16[6] (a0)
+ mulne r10, r8, r9 @ R10=W2*ROWr16[6]
+ @@ a0 += W6*row[6];
+ @@ a3 -= W6*row[6];
+ @@ a1 -= W2*row[6];
+ @@ a2 += W2*row[6];
+ subne r4, r4, r11 @ R4-=W6*ROWr16[6] (a3)
+ subne r2, r2, r10 @ R2-=W2*ROWr16[6] (a1)
+ addne r3, r3, r10 @ R3+=W2*ROWr16[6] (a2)
__end_a_evaluation2:
- @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
- @@ R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
- @@ R12=__const_ptr_, R14=&block[n]
- @@ col[0 ] = ((a0 + b0) >> COL_SHIFT);
- @@ col[8 ] = ((a1 + b1) >> COL_SHIFT);
- @@ col[16] = ((a2 + b2) >> COL_SHIFT);
- @@ col[24] = ((a3 + b3) >> COL_SHIFT);
- @@ col[32] = ((a3 - b3) >> COL_SHIFT);
- @@ col[40] = ((a2 - b2) >> COL_SHIFT);
- @@ col[48] = ((a1 - b1) >> COL_SHIFT);
- @@ col[56] = ((a0 - b0) >> COL_SHIFT);
- @@@@@ no optimisation here @@@@@
- add r8, r6, r0 @ R8=a0+b0
- add r9, r2, r1 @ R9=a1+b1
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #0]
- strh r9, [r14, #16]
- add r8, r3, r5 @ R8=a2+b2
- add r9, r4, r7 @ R9=a3+b3
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #32]
- strh r9, [r14, #48]
- sub r8, r4, r7 @ R8=a3-b3
- sub r9, r3, r5 @ R9=a2-b2
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #64]
- strh r9, [r14, #80]
- sub r8, r2, r1 @ R8=a1-b1
- sub r9, r6, r0 @ R9=a0-b0
- mov r8, r8, asr #COL_SHIFT
- mov r9, r9, asr #COL_SHIFT
- strh r8, [r14, #96]
- strh r9, [r14, #112]
+ @@ at this point, R0=b0, R1=b1, R2=a1, R3=a2, R4=a3,
+ @@ R5=b2, R6=a0, R7=b3, R8 (free), R9 (free), R10 (free), R11 (free),
+ @@ R12=__const_ptr_, R14=&block[n]
+ @@ col[0 ] = ((a0 + b0) >> COL_SHIFT);
+ @@ col[8 ] = ((a1 + b1) >> COL_SHIFT);
+ @@ col[16] = ((a2 + b2) >> COL_SHIFT);
+ @@ col[24] = ((a3 + b3) >> COL_SHIFT);
+ @@ col[32] = ((a3 - b3) >> COL_SHIFT);
+ @@ col[40] = ((a2 - b2) >> COL_SHIFT);
+ @@ col[48] = ((a1 - b1) >> COL_SHIFT);
+ @@ col[56] = ((a0 - b0) >> COL_SHIFT);
+ @@@@@ no optimisation here @@@@@
+ add r8, r6, r0 @ R8=a0+b0
+ add r9, r2, r1 @ R9=a1+b1
+ mov r8, r8, asr #COL_SHIFT
+ mov r9, r9, asr #COL_SHIFT
+ strh r8, [r14, #0]
+ strh r9, [r14, #16]
+ add r8, r3, r5 @ R8=a2+b2
+ add r9, r4, r7 @ R9=a3+b3
+ mov r8, r8, asr #COL_SHIFT
+ mov r9, r9, asr #COL_SHIFT
+ strh r8, [r14, #32]
+ strh r9, [r14, #48]
+ sub r8, r4, r7 @ R8=a3-b3
+ sub r9, r3, r5 @ R9=a2-b2
+ mov r8, r8, asr #COL_SHIFT
+ mov r9, r9, asr #COL_SHIFT
+ strh r8, [r14, #64]
+ strh r9, [r14, #80]
+ sub r8, r2, r1 @ R8=a1-b1
+ sub r9, r6, r0 @ R9=a0-b0
+ mov r8, r8, asr #COL_SHIFT
+ mov r9, r9, asr #COL_SHIFT
+ strh r8, [r14, #96]
+ strh r9, [r14, #112]
__end_col_loop:
- @@ at this point, R0-R11 (free)
- @@ R12=__const_ptr_, R14=&block[n]
- ldr r0, [sp, #0] @ R0=block
- teq r0, r14 @ compare current &block[n] to block, when block is reached, the loop is finished.
- sub r14, r14, #2
- bne __col_loop
+ @@ at this point, R0-R11 (free)
+ @@ R12=__const_ptr_, R14=&block[n]
+ ldr r0, [sp, #0] @ R0=block
+ teq r0, r14 @ compare current &block[n] to block, when block is reached, the loop is finished.
+ sub r14, r14, #2
+ bne __col_loop
@@ -466,15 +466,15 @@
@@ kind of sub-function, here not to overload the common case.
__end_bef_a_evaluation:
- add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
+ add r2, r6, r11 @ R2=a0+W6*ROWr16[2] (a1)
mul r11, r8, r4 @ R11=W2*ROWr16[2]
sub r4, r6, r11 @ R4=a0-W2*ROWr16[2] (a3)
add r6, r6, r11 @ R6=a0+W2*ROWr16[2] (a0)
- bal __end_a_evaluation
+ bal __end_a_evaluation
__constant_ptr__: @@ see #defines at the beginning of the source code for values.
- .align
+ .align
.word W1
.word W2
.word W3
1
0
[Ffmpeg-cvslog] CVS: ffmpeg cmdutils.c, 1.10, 1.11 configure, 1.221, 1.222 cws2fws.c, 1.2, 1.3 ffmpeg.c, 1.357, 1.358 ffplay.c, 1.53, 1.54 ffserver.c, 1.102, 1.103
by diego@mplayerhq.hu 22 Dec '05
by diego@mplayerhq.hu 22 Dec '05
22 Dec '05
Update of /cvsroot/ffmpeg/ffmpeg
In directory mail:/var2/tmp/cvs-serv29491
Modified Files:
cmdutils.c configure cws2fws.c ffmpeg.c ffplay.c ffserver.c
Log Message:
COSMETICS: tabs --> spaces, some prettyprinting
Index: cmdutils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/cmdutils.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cmdutils.c 17 Dec 2005 18:14:25 -0000 1.10
+++ cmdutils.c 22 Dec 2005 01:10:04 -0000 1.11
@@ -96,7 +96,7 @@
if(po->u.func2_arg(opt+1, arg)<0)
goto unknown_opt;
} else {
- po->u.func_arg(arg);
+ po->u.func_arg(arg);
}
} else {
parse_arg_file(opt);
@@ -122,8 +122,8 @@
break;
case AVERROR_IO:
fprintf(stderr, "%s: I/O error occured\n"
- "Usually that means that input file is truncated and/or corrupted.\n",
- filename);
+ "Usually that means that input file is truncated and/or corrupted.\n",
+ filename);
break;
case AVERROR_NOMEM:
fprintf(stderr, "%s: memory allocation error occured\n", filename);
Index: configure
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -d -r1.221 -r1.222
--- configure 22 Dec 2005 00:18:18 -0000 1.221
+++ configure 22 Dec 2005 01:10:04 -0000 1.222
@@ -688,26 +688,26 @@
needmdynamicnopic="no"
if test $targetos = Darwin; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
- CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
+ CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
else
- gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
- case "$gcc_version" in
- *2.95*)
- CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
- ;;
- *[34].*)
- CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
- if test "$lshared" = no; then
- needmdynamicnopic="yes"
- fi
- ;;
- *)
- CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
- if test "$lshared" = no; then
- needmdynamicnopic="yes"
- fi
- ;;
- esac
+ gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
+ case "$gcc_version" in
+ *2.95*)
+ CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
+ ;;
+ *[34].*)
+ CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
+ if test "$lshared" = no; then
+ needmdynamicnopic="yes"
+ fi
+ ;;
+ *)
+ CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
+ if test "$lshared" = no; then
+ needmdynamicnopic="yes"
+ fi
+ ;;
+ esac
fi
fi
@@ -725,62 +725,62 @@
POWERPCMODE="32bits"
if test $tune != "generic"; then
case $tune in
- 601|ppc601|PowerPC601)
- CFLAGS="$CFLAGS -mcpu=601"
- if test $altivec = "yes"; then
- echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
- fi
- TUNECPU=ppc601
- ;;
- 603*|ppc603*|PowerPC603*)
- CFLAGS="$CFLAGS -mcpu=603"
- if test $altivec = "yes"; then
- echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
- fi
- TUNECPU=ppc603
- ;;
- 604*|ppc604*|PowerPC604*)
- CFLAGS="$CFLAGS -mcpu=604"
- if test $altivec = "yes"; then
- echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
- fi
- TUNECPU=ppc604
- ;;
- G3|g3|75*|ppc75*|PowerPC75*)
- CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
- if test $altivec = "yes"; then
- echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
- fi
- TUNECPU=ppc750
- ;;
- G4|g4|745*|ppc745*|PowerPC745*)
- CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
- if test $altivec = "no"; then
- echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
- fi
- TUNECPU=ppc7450
- ;;
- 74*|ppc74*|PowerPC74*)
- CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
- if test $altivec = "no"; then
- echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
- fi
- TUNECPU=ppc7400
- ;;
- G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
- CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
- if test $altivec = "no"; then
- echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
- fi
- TUNECPU=ppc970
+ 601|ppc601|PowerPC601)
+ CFLAGS="$CFLAGS -mcpu=601"
+ if test $altivec = "yes"; then
+ echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
+ fi
+ TUNECPU=ppc601
+ ;;
+ 603*|ppc603*|PowerPC603*)
+ CFLAGS="$CFLAGS -mcpu=603"
+ if test $altivec = "yes"; then
+ echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
+ fi
+ TUNECPU=ppc603
+ ;;
+ 604*|ppc604*|PowerPC604*)
+ CFLAGS="$CFLAGS -mcpu=604"
+ if test $altivec = "yes"; then
+ echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
+ fi
+ TUNECPU=ppc604
+ ;;
+ G3|g3|75*|ppc75*|PowerPC75*)
+ CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
+ if test $altivec = "yes"; then
+ echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
+ fi
+ TUNECPU=ppc750
+ ;;
+ G4|g4|745*|ppc745*|PowerPC745*)
+ CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
+ if test $altivec = "no"; then
+ echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
+ fi
+ TUNECPU=ppc7450
+ ;;
+ 74*|ppc74*|PowerPC74*)
+ CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
+ if test $altivec = "no"; then
+ echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
+ fi
+ TUNECPU=ppc7400
+ ;;
+ G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
+ CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
+ if test $altivec = "no"; then
+ echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
+ fi
+ TUNECPU=ppc970
POWERPCMODE="64bits"
- ;;
- i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
- CFLAGS="$CFLAGS -march=$tune"
- ;;
- *)
- echo "WARNING: Unknown CPU \"$tune\", ignored."
- ;;
+ ;;
+ i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
+ CFLAGS="$CFLAGS -march=$tune"
+ ;;
+ *)
+ echo "WARNING: Unknown CPU \"$tune\", ignored."
+ ;;
esac
fi
@@ -876,8 +876,8 @@
cat > $TMPC << EOF
#include <inttypes.h>
int main(int argc, char ** argv){
- volatile uint32_t i=0x01234567;
- return (*((uint8_t*)(&i))) == 0x67;
+ volatile uint32_t i=0x01234567;
+ return (*((uint8_t*)(&i))) == 0x67;
}
EOF
@@ -912,8 +912,8 @@
cat > $TMPC << EOF
#include <inttypes.h>
int main(int argc, char ** argv){
- volatile uint_fast64_t i=0x01234567;
- return 0;
+ volatile uint_fast64_t i=0x01234567;
+ return 0;
}
EOF
@@ -1152,10 +1152,10 @@
case "`$cc -v 2>&1 | grep version`" in
*gcc*)
- CFLAGS="-Wall -Wno-switch $CFLAGS"
- ;;
+ CFLAGS="-Wall -Wno-switch $CFLAGS"
+ ;;
*)
- ;;
+ ;;
esac
if test "$sdl" = "no" ; then
@@ -1163,7 +1163,7 @@
fi
if test "$debug" = "yes"; then
- CFLAGS="-g $CFLAGS"
+ CFLAGS="-g $CFLAGS"
fi
if test "$optimize" = "small"; then
@@ -1173,10 +1173,10 @@
if test "$optimize" = "yes"; then
if test -n "`$cc -v 2>&1 | grep xlc`"; then
- CFLAGS="$CFLAGS -O5"
- LDFLAGS="$LDFLAGS -O5"
+ CFLAGS="$CFLAGS -O5"
+ LDFLAGS="$LDFLAGS -O5"
else
- CFLAGS="-O3 $CFLAGS"
+ CFLAGS="-O3 $CFLAGS"
fi
fi
@@ -1793,9 +1793,9 @@
diff $TMPH config.h >/dev/null 2>&1
if test $? -ne 0 ; then
- mv -f $TMPH config.h
+ mv -f $TMPH config.h
else
- echo "config.h is unchanged"
+ echo "config.h is unchanged"
fi
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
Index: cws2fws.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/cws2fws.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cws2fws.c 17 Dec 2005 18:14:26 -0000 1.2
+++ cws2fws.c 22 Dec 2005 01:10:05 -0000 1.3
@@ -25,37 +25,37 @@
if (argc < 3)
{
- printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
- exit(1);
+ printf("Usage: %s <infile.swf> <outfile.swf>\n", argv[0]);
+ exit(1);
}
fd_in = open(argv[1], O_RDONLY);
if (fd_in < 0)
{
- perror("Error while opening: ");
- exit(1);
+ perror("Error while opening: ");
+ exit(1);
}
fd_out = open(argv[2], O_WRONLY|O_CREAT, 00644);
if (fd_out < 0)
{
- perror("Error while opening: ");
- close(fd_in);
- exit(1);
+ perror("Error while opening: ");
+ close(fd_in);
+ exit(1);
}
if (read(fd_in, &buf_in, 8) != 8)
{
- printf("Header error\n");
- close(fd_in);
- close(fd_out);
- exit(1);
+ printf("Header error\n");
+ close(fd_in);
+ close(fd_out);
+ exit(1);
}
if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S')
{
- printf("Not a compressed flash file\n");
- exit(1);
+ printf("Not a compressed flash file\n");
+ exit(1);
}
fstat(fd_in, &statbuf);
@@ -75,48 +75,48 @@
for (i = 0; i < comp_len-4;)
{
- int ret, len = read(fd_in, &buf_in, 1024);
+ int ret, len = read(fd_in, &buf_in, 1024);
- dbgprintf("read %d bytes\n", len);
+ dbgprintf("read %d bytes\n", len);
- last_out = zstream.total_out;
+ last_out = zstream.total_out;
- zstream.next_in = &buf_in[0];
- zstream.avail_in = len;
- zstream.next_out = &buf_out[0];
- zstream.avail_out = 1024;
+ zstream.next_in = &buf_in[0];
+ zstream.avail_in = len;
+ zstream.next_out = &buf_out[0];
+ zstream.avail_out = 1024;
- ret = inflate(&zstream, Z_SYNC_FLUSH);
- if (ret == Z_STREAM_END || ret == Z_BUF_ERROR)
- break;
- if (ret != Z_OK)
- {
- printf("Error while decompressing: %d\n", ret);
- inflateEnd(&zstream);
- exit(1);
- }
+ ret = inflate(&zstream, Z_SYNC_FLUSH);
+ if (ret == Z_STREAM_END || ret == Z_BUF_ERROR)
+ break;
+ if (ret != Z_OK)
+ {
+ printf("Error while decompressing: %d\n", ret);
+ inflateEnd(&zstream);
+ exit(1);
+ }
- dbgprintf("a_in: %d t_in: %d a_out: %d t_out: %d -- %d out\n",
- zstream.avail_in, zstream.total_in, zstream.avail_out, zstream.total_out,
- zstream.total_out-last_out);
+ dbgprintf("a_in: %d t_in: %d a_out: %d t_out: %d -- %d out\n",
+ zstream.avail_in, zstream.total_in, zstream.avail_out, zstream.total_out,
+ zstream.total_out-last_out);
- write(fd_out, &buf_out, zstream.total_out-last_out);
+ write(fd_out, &buf_out, zstream.total_out-last_out);
- i += len;
+ i += len;
}
if (zstream.total_out != uncomp_len-8)
{
- printf("Size mismatch (%d != %d), updating header...\n",
- zstream.total_out, uncomp_len-8);
+ printf("Size mismatch (%d != %d), updating header...\n",
+ zstream.total_out, uncomp_len-8);
- buf_in[0] = (zstream.total_out+8) & 0xff;
- buf_in[1] = (zstream.total_out+8 >> 8) & 0xff;
- buf_in[2] = (zstream.total_out+8 >> 16) & 0xff;
- buf_in[3] = (zstream.total_out+8 >> 24) & 0xff;
+ buf_in[0] = (zstream.total_out+8) & 0xff;
+ buf_in[1] = (zstream.total_out+8 >> 8) & 0xff;
+ buf_in[2] = (zstream.total_out+8 >> 16) & 0xff;
+ buf_in[3] = (zstream.total_out+8 >> 24) & 0xff;
- lseek(fd_out, 4, SEEK_SET);
- write(fd_out, &buf_in, 4);
+ lseek(fd_out, 4, SEEK_SET);
+ write(fd_out, &buf_in, 4);
}
inflateEnd(&zstream);
Index: ffmpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/ffmpeg.c,v
retrieving revision 1.357
retrieving revision 1.358
diff -u -d -r1.357 -r1.358
--- ffmpeg.c 18 Dec 2005 20:01:02 -0000 1.357
+++ ffmpeg.c 22 Dec 2005 01:10:05 -0000 1.358
@@ -579,7 +579,7 @@
break;
}
ret = avcodec_encode_audio(enc, audio_out, size_out,
- (short *)buftmp);
+ (short *)buftmp);
audio_size += ret;
pkt.stream_index= ost->index;
pkt.data= audio_out;
@@ -821,10 +821,10 @@
padcolor);
}
- if (enc->pix_fmt != PIX_FMT_YUV420P) {
+ if (enc->pix_fmt != PIX_FMT_YUV420P) {
int size;
- av_free(buf);
+ av_free(buf);
/* create temporary picture */
size = avpicture_get_size(enc->pix_fmt, enc->width, enc->height);
buf = av_malloc(size);
@@ -842,7 +842,7 @@
goto the_end;
}
- }
+ }
} else if (ost->video_crop) {
picture_crop_temp.data[0] = formatted_picture->data[0] +
(ost->topBand * formatted_picture->linesize[0]) + ost->leftBand;
@@ -921,7 +921,7 @@
avoid any copies. We support temorarily the older
method. */
AVFrame* old_frame = enc->coded_frame;
- enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
+ enc->coded_frame = dec->coded_frame; //FIXME/XXX remove this hack
pkt.data= (uint8_t *)final_picture;
pkt.size= sizeof(AVPicture);
if(dec->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
@@ -930,7 +930,7 @@
pkt.flags |= PKT_FLAG_KEY;
av_interleaved_write_frame(s, &pkt);
- enc->coded_frame = old_frame;
+ enc->coded_frame = old_frame;
} else {
AVFrame big_picture;
@@ -1044,8 +1044,8 @@
}
static void print_report(AVFormatContext **output_files,
- AVOutputStream **ost_table, int nb_ostreams,
- int is_last_report)
+ AVOutputStream **ost_table, int nb_ostreams,
+ int is_last_report)
{
char buf[1024];
AVOutputStream *ost;
@@ -1138,9 +1138,9 @@
"size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s",
(double)total_size / 1024, ti1, bitrate);
- if (verbose > 1)
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
- nb_frames_dup, nb_frames_drop);
+ if (verbose > 1)
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
+ nb_frames_dup, nb_frames_drop);
if (verbose >= 0)
fprintf(stderr, "%s \r", buf);
@@ -1323,7 +1323,7 @@
}
#endif
/* if output time reached then transcode raw format,
- encode packets and output them */
+ encode packets and output them */
if (start_time == 0 || ist->pts >= start_time)
for(i=0;i<nb_ostreams;i++) {
int frame_size;
@@ -1898,7 +1898,7 @@
/* init pts */
for(i=0;i<nb_istreams;i++) {
ist = ist_table[i];
- is = input_files[ist->file_index];
+ is = input_files[ist->file_index];
ist->pts = 0;
ist->next_pts = av_rescale_q(ist->st->start_time, ist->st->time_base, AV_TIME_BASE_Q);
if(ist->st->start_time == AV_NOPTS_VALUE)
@@ -2273,7 +2273,7 @@
{
if (parse_frame_rate(&frame_rate, &frame_rate_base, arg) < 0) {
fprintf(stderr, "Incorrect frame rate\n");
- exit(1);
+ exit(1);
}
}
@@ -2289,7 +2289,7 @@
exit(1);
}
if ((frame_topBand) >= frame_height){
- fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
+ fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_height -= frame_topBand;
@@ -2307,7 +2307,7 @@
exit(1);
}
if ((frame_bottomBand) >= frame_height){
- fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
+ fprintf(stderr, "Vertical crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_height -= frame_bottomBand;
@@ -2325,7 +2325,7 @@
exit(1);
}
if ((frame_leftBand) >= frame_width){
- fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
+ fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_width -= frame_leftBand;
@@ -2343,7 +2343,7 @@
exit(1);
}
if ((frame_rightBand) >= frame_width){
- fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
+ fprintf(stderr, "Horizontal crop dimensions are outside the range of the original image.\nRemember to crop first and scale second.\n");
exit(1);
}
frame_width -= frame_rightBand;
@@ -2364,7 +2364,7 @@
#define SCALEBITS 10
#define ONE_HALF (1 << (SCALEBITS - 1))
-#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
+#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
#define RGB_TO_Y(r, g, b) \
((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \
@@ -2462,16 +2462,16 @@
p = strchr(arg, ':');
if (p) {
x = strtol(arg, (char **)&arg, 10);
- if (arg == p)
- y = strtol(arg+1, (char **)&arg, 10);
- if (x > 0 && y > 0)
- ar = (double)x / (double)y;
+ if (arg == p)
+ y = strtol(arg+1, (char **)&arg, 10);
+ if (x > 0 && y > 0)
+ ar = (double)x / (double)y;
} else
ar = strtod(arg, (char **)&arg);
if (!ar) {
fprintf(stderr, "Incorrect aspect ratio specification.\n");
- exit(1);
+ exit(1);
}
frame_aspect_ratio = ar;
}
@@ -2957,8 +2957,8 @@
}
frame_height = enc->height;
frame_width = enc->width;
- frame_aspect_ratio = av_q2d(enc->sample_aspect_ratio) * enc->width / enc->height;
- frame_pix_fmt = enc->pix_fmt;
+ frame_aspect_ratio = av_q2d(enc->sample_aspect_ratio) * enc->width / enc->height;
+ frame_pix_fmt = enc->pix_fmt;
rfps = ic->streams[i]->r_frame_rate.num;
rfps_base = ic->streams[i]->r_frame_rate.den;
enc->workaround_bugs = workaround_bugs;
@@ -3454,7 +3454,7 @@
oc->timestamp = rec_timestamp;
- if (str_title)
+ if (str_title)
pstrcpy(oc->title, sizeof(oc->title), str_title);
if (str_author)
pstrcpy(oc->author, sizeof(oc->author), str_author);
@@ -3490,11 +3490,11 @@
fprintf(stderr, "Not overwriting - exiting\n");
exit(1);
}
- }
- else {
+ }
+ else {
fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
exit(1);
- }
+ }
}
}
@@ -3579,14 +3579,14 @@
fmt1 = av_find_input_format(video_grab_format);
vp->device = video_device;
vp->channel = video_channel;
- vp->standard = video_standard;
+ vp->standard = video_standard;
if (av_open_input_file(&ic, "", fmt1, 0, vp) < 0) {
fprintf(stderr, "Could not find video grab device\n");
exit(1);
}
/* If not enough info to get the stream parameters, we decode the
first frames to get it. */
- if ((ic->ctx_flags & AVFMTCTX_NOHEADER) && av_find_stream_info(ic) < 0) {
+ if ((ic->ctx_flags & AVFMTCTX_NOHEADER) && av_find_stream_info(ic) < 0) {
fprintf(stderr, "Could not find video grab parameters\n");
exit(1);
}
@@ -4276,11 +4276,11 @@
for(i=0;i<nb_output_files;i++) {
/* maybe av_close_output_file ??? */
AVFormatContext *s = output_files[i];
- int j;
+ int j;
if (!(s->oformat->flags & AVFMT_NOFILE))
- url_fclose(&s->pb);
- for(j=0;j<s->nb_streams;j++)
- av_free(s->streams[j]);
+ url_fclose(&s->pb);
+ for(j=0;j<s->nb_streams;j++)
+ av_free(s->streams[j]);
av_free(s);
}
for(i=0;i<nb_input_files;i++)
Index: ffplay.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/ffplay.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- ffplay.c 17 Dec 2005 18:14:26 -0000 1.53
+++ ffplay.c 22 Dec 2005 01:10:05 -0000 1.54
@@ -1649,7 +1649,7 @@
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
packet_queue_init(&is->audioq);
- SDL_PauseAudio(0);
+ SDL_PauseAudio(0);
break;
case CODEC_TYPE_VIDEO:
is->video_stream = stream_index;
@@ -1937,11 +1937,11 @@
}
ret = av_read_frame(ic, pkt);
if (ret < 0) {
- if (url_ferror(&ic->pb) == 0) {
+ if (url_ferror(&ic->pb) == 0) {
SDL_Delay(100); /* wait for user event */
- continue;
- } else
- break;
+ continue;
+ } else
+ break;
}
if (pkt->stream_index == is->audio_stream) {
packet_queue_put(&is->audioq, pkt);
@@ -2224,23 +2224,23 @@
}
break;
case SDL_MOUSEBUTTONDOWN:
- if (cur_stream) {
- int ns, hh, mm, ss;
- int tns, thh, tmm, tss;
- tns = cur_stream->ic->duration/1000000LL;
- thh = tns/3600;
- tmm = (tns%3600)/60;
- tss = (tns%60);
- frac = (double)event.button.x/(double)cur_stream->width;
- ns = frac*tns;
- hh = ns/3600;
- mm = (ns%3600)/60;
- ss = (ns%60);
- fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100,
- hh, mm, ss, thh, tmm, tss);
- stream_seek(cur_stream, (int64_t)(cur_stream->ic->start_time+frac*cur_stream->ic->duration), 0);
- }
- break;
+ if (cur_stream) {
+ int ns, hh, mm, ss;
+ int tns, thh, tmm, tss;
+ tns = cur_stream->ic->duration/1000000LL;
+ thh = tns/3600;
+ tmm = (tns%3600)/60;
+ tss = (tns%60);
+ frac = (double)event.button.x/(double)cur_stream->width;
+ ns = frac*tns;
+ hh = ns/3600;
+ mm = (ns%3600)/60;
+ ss = (ns%60);
+ fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100,
+ hh, mm, ss, thh, tmm, tss);
+ stream_seek(cur_stream, (int64_t)(cur_stream->ic->start_time+frac*cur_stream->ic->duration), 0);
+ }
+ break;
case SDL_VIDEORESIZE:
if (cur_stream) {
screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 0,
@@ -2452,7 +2452,7 @@
if (dpy) {
fs_screen_width = DisplayWidth(dpy, DefaultScreen(dpy));
fs_screen_height = DisplayHeight(dpy, DefaultScreen(dpy));
- XCloseDisplay(dpy);
+ XCloseDisplay(dpy);
}
}
#endif
Index: ffserver.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/ffserver.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- ffserver.c 17 Dec 2005 18:14:26 -0000 1.102
+++ ffserver.c 22 Dec 2005 01:10:05 -0000 1.103
@@ -1204,7 +1204,7 @@
pstrcpy(c->protocol, sizeof(c->protocol), protocol);
if (ffserver_debug)
- http_log("New connection: %s %s\n", cmd, url);
+ http_log("New connection: %s %s\n", cmd, url);
/* find the filename and the optional info string in the request */
p = url;
@@ -2001,7 +2001,7 @@
c->fmt_ctx.nb_streams = c->stream->nb_streams;
for(i=0;i<c->fmt_ctx.nb_streams;i++) {
AVStream *st;
- AVStream *src;
+ AVStream *src;
st = av_mallocz(sizeof(AVStream));
st->codec= avcodec_alloc_context();
c->fmt_ctx.streams[i] = st;
@@ -2012,8 +2012,8 @@
else
src = c->stream->feed->streams[c->stream->feed_streams[i]];
- *st = *src;
- st->priv_data = 0;
+ *st = *src;
+ st->priv_data = 0;
st->codec->frame_number = 0; /* XXX: should be done in
AVStream, not in codec */
/* I'm pretty sure that this is not correct...
@@ -2452,8 +2452,8 @@
s.priv_data = av_mallocz(fmt_in->priv_data_size);
if (!s.priv_data)
goto fail;
- } else
- s.priv_data = NULL;
+ } else
+ s.priv_data = NULL;
if (fmt_in->read_header(&s, 0) < 0) {
av_freep(&s.priv_data);
@@ -3868,20 +3868,20 @@
feed->child_argv[i] = av_malloc(30 + strlen(feed->filename));
- snprintf(feed->child_argv[i], 30+strlen(feed->filename),
- "http://%s:%d/%s",
- (my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
- inet_ntoa(my_http_addr.sin_addr),
- ntohs(my_http_addr.sin_port), feed->filename);
+ snprintf(feed->child_argv[i], 30+strlen(feed->filename),
+ "http://%s:%d/%s",
+ (my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
+ inet_ntoa(my_http_addr.sin_addr),
+ ntohs(my_http_addr.sin_port), feed->filename);
- if (ffserver_debug)
- {
- int j;
- fprintf(stdout, "Launch commandline: ");
- for (j = 0; j <= i; j++)
- fprintf(stdout, "%s ", feed->child_argv[j]);
- fprintf(stdout, "\n");
- }
+ if (ffserver_debug)
+ {
+ int j;
+ fprintf(stdout, "Launch commandline: ");
+ for (j = 0; j <= i; j++)
+ fprintf(stdout, "%s ", feed->child_argv[j]);
+ fprintf(stdout, "\n");
+ }
}
} else if (!strcasecmp(cmd, "ReadOnlyFile")) {
if (feed) {
@@ -4074,8 +4074,8 @@
if (stream) {
audio_enc.sample_rate = atoi(arg);
}
- } else if (!strcasecmp(cmd, "AudioQuality")) {
- get_arg(arg, sizeof(arg), &p);
+ } else if (!strcasecmp(cmd, "AudioQuality")) {
+ get_arg(arg, sizeof(arg), &p);
if (stream) {
// audio_enc.quality = atof(arg) * 1000;
}
1
0
Update of /cvsroot/ffmpeg/ffmpeg/doc
In directory mail:/var2/tmp/cvs-serv29491/doc
Modified Files:
texi2pod.pl
Log Message:
COSMETICS: tabs --> spaces, some prettyprinting
Index: texi2pod.pl
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/doc/texi2pod.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- texi2pod.pl 17 Dec 2005 18:14:26 -0000 1.2
+++ texi2pod.pl 22 Dec 2005 01:10:05 -0000 1.3
@@ -39,24 +39,24 @@
while ($_ = shift) {
if (/^-D(.*)$/) {
- if ($1 ne "") {
- $flag = $1;
- } else {
- $flag = shift;
- }
- $value = "";
- ($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/);
- die "no flag specified for -D\n"
- unless $flag ne "";
- die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
- unless $flag =~ /^[a-zA-Z0-9_-]+$/;
- $defs{$flag} = $value;
+ if ($1 ne "") {
+ $flag = $1;
+ } else {
+ $flag = shift;
+ }
+ $value = "";
+ ($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/);
+ die "no flag specified for -D\n"
+ unless $flag ne "";
+ die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
+ unless $flag =~ /^[a-zA-Z0-9_-]+$/;
+ $defs{$flag} = $value;
} elsif (/^-/) {
- usage();
+ usage();
} else {
- $in = $_, next unless defined $in;
- $out = $_, next unless defined $out;
- usage();
+ $in = $_, next unless defined $in;
+ $out = $_, next unless defined $out;
+ usage();
}
}
@@ -76,13 +76,13 @@
while(<$inf>) {
# Certain commands are discarded without further processing.
/^\@(?:
- [a-z]+index # @*index: useful only in complete manual
- |need # @need: useful only in printed manual
- |(?:end\s+)?group # @group .. @end group: ditto
- |page # @page: ditto
- |node # @node: useful only in .info file
- |(?:end\s+)?ifnottex # @ifnottex .. @end ifnottex: use contents
- )\b/x and next;
+ [a-z]+index # @*index: useful only in complete manual
+ |need # @need: useful only in printed manual
+ |(?:end\s+)?group # @group .. @end group: ditto
+ |page # @page: ditto
+ |node # @node: useful only in .info file
+ |(?:end\s+)?ifnottex # @ifnottex .. @end ifnottex: use contents
+ )\b/x and next;
chomp;
@@ -92,38 +92,38 @@
# Identify a man title but keep only the one we are interested in.
/^\(a)c\s+man\s+title\s+([A-Za-z0-9-]+)\s+(.+)/ and do {
- if (exists $defs{$1}) {
- $fn = $1;
- $tl = postprocess($2);
- }
- next;
+ if (exists $defs{$1}) {
+ $fn = $1;
+ $tl = postprocess($2);
+ }
+ next;
};
# Look for blocks surrounded by @c man begin SECTION ... @c man end.
# This really oughta be @ifman ... @end ifman and the like, but such
# would require rev'ing all other Texinfo translators.
/^\@c\s+man\s+begin\s+([A-Z]+)\s+([A-Za-z0-9-]+)/ and do {
- $output = 1 if exists $defs{$2};
+ $output = 1 if exists $defs{$2};
$sect = $1;
- next;
+ next;
};
/^\@c\s+man\s+begin\s+([A-Z]+)/ and $sect = $1, $output = 1, next;
/^\@c\s+man\s+end/ and do {
- $sects{$sect} = "" unless exists $sects{$sect};
- $sects{$sect} .= postprocess($section);
- $section = "";
- $output = 0;
- next;
+ $sects{$sect} = "" unless exists $sects{$sect};
+ $sects{$sect} .= postprocess($section);
+ $section = "";
+ $output = 0;
+ next;
};
# handle variables
/^\(a)set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and do {
- $defs{$1} = $2;
- next;
+ $defs{$1} = $2;
+ next;
};
/^\@clear\s+([a-zA-Z0-9_-]+)/ and do {
- delete $defs{$1};
- next;
+ delete $defs{$1};
+ next;
};
next unless $output;
@@ -135,55 +135,55 @@
# End-block handler goes up here because it needs to operate even
# if we are skipping.
/^\@end\s+([a-z]+)/ and do {
- # Ignore @end foo, where foo is not an operation which may
- # cause us to skip, if we are presently skipping.
- my $ended = $1;
- next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex)$/;
+ # Ignore @end foo, where foo is not an operation which may
+ # cause us to skip, if we are presently skipping.
+ my $ended = $1;
+ next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex)$/;
- die "\@end $ended without \@$ended at line $.\n" unless defined $endw;
- die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw;
+ die "\@end $ended without \@$ended at line $.\n" unless defined $endw;
+ die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw;
- $endw = pop @endwstack;
+ $endw = pop @endwstack;
- if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
- $skipping = pop @skstack;
- next;
- } elsif ($ended =~ /^(?:example|smallexample|display)$/) {
- $shift = "";
- $_ = ""; # need a paragraph break
- } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
- $_ = "\n=back\n";
- $ic = pop @icstack;
- } else {
- die "unknown command \@end $ended at line $.\n";
- }
+ if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) {
+ $skipping = pop @skstack;
+ next;
+ } elsif ($ended =~ /^(?:example|smallexample|display)$/) {
+ $shift = "";
+ $_ = ""; # need a paragraph break
+ } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) {
+ $_ = "\n=back\n";
+ $ic = pop @icstack;
+ } else {
+ die "unknown command \@end $ended at line $.\n";
+ }
};
# We must handle commands which can cause skipping even while we
# are skipping, otherwise we will not process nested conditionals
# correctly.
/^\@ifset\s+([a-zA-Z0-9_-]+)/ and do {
- push @endwstack, $endw;
- push @skstack, $skipping;
- $endw = "ifset";
- $skipping = 1 unless exists $defs{$1};
- next;
+ push @endwstack, $endw;
+ push @skstack, $skipping;
+ $endw = "ifset";
+ $skipping = 1 unless exists $defs{$1};
+ next;
};
/^\@ifclear\s+([a-zA-Z0-9_-]+)/ and do {
- push @endwstack, $endw;
- push @skstack, $skipping;
- $endw = "ifclear";
- $skipping = 1 if exists $defs{$1};
- next;
+ push @endwstack, $endw;
+ push @skstack, $skipping;
+ $endw = "ifclear";
+ $skipping = 1 if exists $defs{$1};
+ next;
};
/^\@(ignore|menu|iftex)\b/ and do {
- push @endwstack, $endw;
- push @skstack, $skipping;
- $endw = $1;
- $skipping = 1;
- next;
+ push @endwstack, $endw;
+ push @skstack, $skipping;
+ $endw = $1;
+ $skipping = 1;
+ next;
};
next if $skipping;
@@ -210,85 +210,85 @@
# Inside a verbatim block, handle @var specially.
if ($shift ne "") {
- s/\@var\{([^\}]*)\}/<$1>/g;
+ s/\@var\{([^\}]*)\}/<$1>/g;
}
# POD doesn't interpret E<> inside a verbatim block.
if ($shift eq "") {
- s/</</g;
- s/>/>/g;
+ s/</</g;
+ s/>/>/g;
} else {
- s/</</g;
- s/>/>/g;
+ s/</</g;
+ s/>/>/g;
}
# Single line command handlers.
/^\(a)include\s+(.+)$/ and do {
- push @instack, $inf;
- $inf = gensym();
+ push @instack, $inf;
+ $inf = gensym();
- # Try cwd and $ibase.
- open($inf, "<" . $1)
- or open($inf, "<" . $ibase . "/" . $1)
- or die "cannot open $1 or $ibase/$1: $!\n";
- next;
+ # Try cwd and $ibase.
+ open($inf, "<" . $1)
+ or open($inf, "<" . $ibase . "/" . $1)
+ or die "cannot open $1 or $ibase/$1: $!\n";
+ next;
};
/^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
- and $_ = "\n=head2 $1\n";
+ and $_ = "\n=head2 $1\n";
/^\(a)subsection\s+(.+)$/
- and $_ = "\n=head3 $1\n";
+ and $_ = "\n=head3 $1\n";
# Block command handlers:
/^\@itemize\s+(\@[a-z]+|\*|-)/ and do {
- push @endwstack, $endw;
- push @icstack, $ic;
- $ic = $1;
- $_ = "\n=over 4\n";
- $endw = "itemize";
+ push @endwstack, $endw;
+ push @icstack, $ic;
+ $ic = $1;
+ $_ = "\n=over 4\n";
+ $endw = "itemize";
};
/^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do {
- push @endwstack, $endw;
- push @icstack, $ic;
- if (defined $1) {
- $ic = $1 . ".";
- } else {
- $ic = "1.";
- }
- $_ = "\n=over 4\n";
- $endw = "enumerate";
+ push @endwstack, $endw;
+ push @icstack, $ic;
+ if (defined $1) {
+ $ic = $1 . ".";
+ } else {
+ $ic = "1.";
+ }
+ $_ = "\n=over 4\n";
+ $endw = "enumerate";
};
/^\@([fv]?table)\s+(\@[a-z]+)/ and do {
- push @endwstack, $endw;
- push @icstack, $ic;
- $endw = $1;
- $ic = $2;
- $ic =~ s/\@(?:samp|strong|key|gcctabopt|option|env)/B/;
- $ic =~ s/\@(?:code|kbd)/C/;
- $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
- $ic =~ s/\@(?:file)/F/;
- $_ = "\n=over 4\n";
+ push @endwstack, $endw;
+ push @icstack, $ic;
+ $endw = $1;
+ $ic = $2;
+ $ic =~ s/\@(?:samp|strong|key|gcctabopt|option|env)/B/;
+ $ic =~ s/\@(?:code|kbd)/C/;
+ $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/;
+ $ic =~ s/\@(?:file)/F/;
+ $_ = "\n=over 4\n";
};
/^\@((?:small)?example|display)/ and do {
- push @endwstack, $endw;
- $endw = $1;
- $shift = "\t";
- $_ = ""; # need a paragraph break
+ push @endwstack, $endw;
+ $endw = $1;
+ $shift = "\t";
+ $_ = ""; # need a paragraph break
};
/^\(a)itemx?\s*(.+)?$/ and do {
- if (defined $1) {
- # Entity escapes prevent munging by the <> processing below.
- $_ = "\n=item $ic\<$1\>\n";
- } else {
- $_ = "\n=item $ic\n";
- $ic =~ y/A-Ya-y/B-Zb-z/;
- $ic =~ s/(\d+)/$1 + 1/eg;
- }
+ if (defined $1) {
+ # Entity escapes prevent munging by the <> processing below.
+ $_ = "\n=item $ic\<$1\>\n";
+ } else {
+ $_ = "\n=item $ic\n";
+ $ic =~ y/A-Ya-y/B-Zb-z/;
+ $ic =~ s/(\d+)/$1 + 1/eg;
+ }
};
$section .= $shift.$_."\n";
@@ -304,13 +304,13 @@
$sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES};
for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES ENVIRONMENT FILES
- BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
+ BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
if(exists $sects{$sect}) {
- $head = $sect;
- $head =~ s/SEEALSO/SEE ALSO/;
- print "=head1 $head\n\n";
- print scalar unmunge ($sects{$sect});
- print "\n";
+ $head = $sect;
+ $head =~ s/SEEALSO/SEE ALSO/;
+ print "=head1 $head\n\n";
+ print scalar unmunge ($sects{$sect});
+ print "\n";
}
}
@@ -325,13 +325,13 @@
# @value{foo} is replaced by whatever 'foo' is defined as.
while (m/(\@value\{([a-zA-Z0-9_-]+)\})/g) {
- if (! exists $defs{$2}) {
- print STDERR "Option $2 not defined\n";
- s/\Q$1\E//;
- } else {
- $value = $defs{$2};
- s/\Q$1\E/$value/;
- }
+ if (! exists $defs{$2}) {
+ print STDERR "Option $2 not defined\n";
+ s/\Q$1\E//;
+ } else {
+ $value = $defs{$2};
+ s/\Q$1\E/$value/;
+ }
}
# Formatting commands.
@@ -381,9 +381,9 @@
# processing because otherwise the regexp will choke on formatting
# inside @footnote.
while (/\@footnote/g) {
- s/\@footnote\{([^\}]+)\}/[$fnno]/;
- add_footnote($1, $fnno);
- $fnno++;
+ s/\@footnote\{([^\}]+)\}/[$fnno]/;
+ add_footnote($1, $fnno);
+ $fnno++;
}
return $_;
@@ -406,7 +406,7 @@
sub add_footnote
{
unless (exists $sects{FOOTNOTES}) {
- $sects{FOOTNOTES} = "\n=over 4\n\n";
+ $sects{FOOTNOTES} = "\n=over 4\n\n";
}
$sects{FOOTNOTES} .= "=item $fnno.\n\n"; $fnno++;
@@ -419,9 +419,9 @@
my $genseq = 0;
sub gensym
{
- my $name = "GEN" . $genseq++;
- my $ref = \*{$name};
- delete $::{$name};
- return $ref;
+ my $name = "GEN" . $genseq++;
+ my $ref = \*{$name};
+ delete $::{$name};
+ return $ref;
}
}
1
0
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv29491/libavformat
Modified Files:
asf-enc.c asf.c asf.h audio.c avformat.h avi.h avidec.c
avienc.c aviobuf.c barpainet.c cutils.c dc1394.c dv.c dv1394.c
dv1394.h ffm.c flvdec.c flvenc.c gif.c gifdec.c grab.c
matroska.c mov.c movenc.c mpegtsenc.c nsvdec.c nut.c ogg.c
ogg2.c oggparsetheora.c raw.c rm.c rtpproto.c rtsp.c
sierravmd.c swf.c utils.c wav.c wc3movie.c yuv4mpeg.c
Log Message:
COSMETICS: tabs --> spaces, some prettyprinting
Index: asf-enc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/asf-enc.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- asf-enc.c 17 Dec 2005 18:14:36 -0000 1.74
+++ asf-enc.c 22 Dec 2005 01:10:10 -0000 1.75
@@ -26,14 +26,14 @@
#ifdef CONFIG_MUXERS
-#define ASF_INDEXED_INTERVAL 10000000
-#define ASF_INDEX_BLOCK 600
+#define ASF_INDEXED_INTERVAL 10000000
+#define ASF_INDEX_BLOCK 600
#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
#define ASF_PACKET_ERROR_CORRECTION_FLAGS (\
- ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT | \
- ASF_PACKET_ERROR_CORRECTION_DATA_SIZE\
- )
+ ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT | \
+ ASF_PACKET_ERROR_CORRECTION_DATA_SIZE\
+ )
#if (ASF_PACKET_ERROR_CORRECTION_FLAGS != 0)
# define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 1
@@ -42,11 +42,11 @@
#endif
#define ASF_PPI_PROPERTY_FLAGS (\
- ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE | \
- ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD | \
- ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE | \
- ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE \
- )
+ ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE | \
+ ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD | \
+ ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE | \
+ ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE \
+ )
#define ASF_PPI_LENGTH_TYPE_FLAGS 0
@@ -142,50 +142,50 @@
#endif
#define PACKET_HEADER_MIN_SIZE (\
- ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE + \
- ASF_PACKET_ERROR_CORRECTION_DATA_SIZE + \
- 1 + /*Length Type Flags*/ \
- 1 + /*Property Flags*/ \
- ASF_PPI_PACKET_LENGTH_FIELD_SIZE + \
- ASF_PPI_SEQUENCE_FIELD_SIZE + \
- ASF_PPI_PADDING_LENGTH_FIELD_SIZE + \
- 4 + /*Send Time Field*/ \
- 2 /*Duration Field*/ \
- )
+ ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE + \
+ ASF_PACKET_ERROR_CORRECTION_DATA_SIZE + \
+ 1 + /*Length Type Flags*/ \
+ 1 + /*Property Flags*/ \
+ ASF_PPI_PACKET_LENGTH_FIELD_SIZE + \
+ ASF_PPI_SEQUENCE_FIELD_SIZE + \
+ ASF_PPI_PADDING_LENGTH_FIELD_SIZE + \
+ 4 + /*Send Time Field*/ \
+ 2 /*Duration Field*/ \
+ )
// Replicated Data shall be at least 8 bytes long.
#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH 0x08
#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD (\
- 1 + /*Stream Number*/ \
- ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
- ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
- ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
- ASF_PAYLOAD_REPLICATED_DATA_LENGTH \
- )
+ 1 + /*Stream Number*/ \
+ ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
+ ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
+ ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
+ ASF_PAYLOAD_REPLICATED_DATA_LENGTH \
+ )
#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS (\
- 1 + /*Stream Number*/ \
- ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
- ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
- ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
- ASF_PAYLOAD_REPLICATED_DATA_LENGTH + \
- ASF_PAYLOAD_LENGTH_FIELD_SIZE \
- )
+ 1 + /*Stream Number*/ \
+ ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
+ ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
+ ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
+ ASF_PAYLOAD_REPLICATED_DATA_LENGTH + \
+ ASF_PAYLOAD_LENGTH_FIELD_SIZE \
+ )
#define SINGLE_PAYLOAD_DATA_LENGTH (\
- PACKET_SIZE - \
- PACKET_HEADER_MIN_SIZE - \
- PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD \
- )
+ PACKET_SIZE - \
+ PACKET_HEADER_MIN_SIZE - \
+ PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD \
+ )
#define MULTI_PAYLOAD_CONSTANT (\
- PACKET_SIZE - \
- PACKET_HEADER_MIN_SIZE - \
- 1 - /*Payload Flags*/ \
- 2*PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS \
- )
+ PACKET_SIZE - \
+ PACKET_HEADER_MIN_SIZE - \
+ 1 - /*Payload Flags*/ \
+ 2*PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS \
+ )
static int preroll_time = 2000;
@@ -653,11 +653,11 @@
static void put_frame(
AVFormatContext *s,
ASFStream *stream,
- int timestamp,
+ int timestamp,
const uint8_t *buf,
- int m_obj_size,
+ int m_obj_size,
int flags
- )
+ )
{
ASFContext *asf = s->priv_data;
int m_obj_offset, payload_len, frag_len1;
Index: asf.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/asf.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- asf.c 17 Dec 2005 18:14:36 -0000 1.88
+++ asf.c 22 Dec 2005 01:10:10 -0000 1.89
@@ -169,18 +169,18 @@
goto fail;
if (!memcmp(&g, &file_header, sizeof(GUID))) {
get_guid(pb, &asf->hdr.guid);
- asf->hdr.file_size = get_le64(pb);
- asf->hdr.create_time = get_le64(pb);
- asf->hdr.packets_count = get_le64(pb);
- asf->hdr.send_time = get_le64(pb);
- asf->hdr.play_time = get_le64(pb);
- asf->hdr.preroll = get_le32(pb);
- asf->hdr.ignore = get_le32(pb);
- asf->hdr.flags = get_le32(pb);
- asf->hdr.min_pktsize = get_le32(pb);
- asf->hdr.max_pktsize = get_le32(pb);
- asf->hdr.max_bitrate = get_le32(pb);
- asf->packet_size = asf->hdr.max_pktsize;
+ asf->hdr.file_size = get_le64(pb);
+ asf->hdr.create_time = get_le64(pb);
+ asf->hdr.packets_count = get_le64(pb);
+ asf->hdr.send_time = get_le64(pb);
+ asf->hdr.play_time = get_le64(pb);
+ asf->hdr.preroll = get_le32(pb);
+ asf->hdr.ignore = get_le32(pb);
+ asf->hdr.flags = get_le32(pb);
+ asf->hdr.min_pktsize = get_le32(pb);
+ asf->hdr.max_pktsize = get_le32(pb);
+ asf->hdr.max_bitrate = get_le32(pb);
+ asf->packet_size = asf->hdr.max_pktsize;
asf->nb_packets = asf->hdr.packets_count;
} else if (!memcmp(&g, &stream_header, sizeof(GUID))) {
int type, total_size, type_specific_size, sizeX;
@@ -214,32 +214,32 @@
total_size = get_le64(pb);
type_specific_size = get_le32(pb);
get_le32(pb);
- st->id = get_le16(pb) & 0x7f; /* stream id */
+ st->id = get_le16(pb) & 0x7f; /* stream id */
// mapping of asf ID to AV stream ID;
asf->asfid2avid[st->id] = s->nb_streams - 1;
get_le32(pb);
- st->codec->codec_type = type;
+ st->codec->codec_type = type;
if (type == CODEC_TYPE_AUDIO) {
get_wav_header(pb, st->codec, type_specific_size);
st->need_parsing = 1;
- /* We have to init the frame size at some point .... */
- pos2 = url_ftell(pb);
- if (gsize > (pos2 + 8 - pos1 + 24)) {
- asf_st->ds_span = get_byte(pb);
- asf_st->ds_packet_size = get_le16(pb);
- asf_st->ds_chunk_size = get_le16(pb);
- asf_st->ds_data_size = get_le16(pb);
- asf_st->ds_silence_data = get_byte(pb);
- }
- //printf("Descrambling: ps:%d cs:%d ds:%d s:%d sd:%d\n",
- // asf_st->ds_packet_size, asf_st->ds_chunk_size,
- // asf_st->ds_data_size, asf_st->ds_span, asf_st->ds_silence_data);
- if (asf_st->ds_span > 1) {
- if (!asf_st->ds_chunk_size
- || (asf_st->ds_packet_size/asf_st->ds_chunk_size <= 1))
- asf_st->ds_span = 0; // disable descrambling
- }
+ /* We have to init the frame size at some point .... */
+ pos2 = url_ftell(pb);
+ if (gsize > (pos2 + 8 - pos1 + 24)) {
+ asf_st->ds_span = get_byte(pb);
+ asf_st->ds_packet_size = get_le16(pb);
+ asf_st->ds_chunk_size = get_le16(pb);
+ asf_st->ds_data_size = get_le16(pb);
+ asf_st->ds_silence_data = get_byte(pb);
+ }
+ //printf("Descrambling: ps:%d cs:%d ds:%d s:%d sd:%d\n",
+ // asf_st->ds_packet_size, asf_st->ds_chunk_size,
+ // asf_st->ds_data_size, asf_st->ds_span, asf_st->ds_silence_data);
+ if (asf_st->ds_span > 1) {
+ if (!asf_st->ds_chunk_size
+ || (asf_st->ds_packet_size/asf_st->ds_chunk_size <= 1))
+ asf_st->ds_span = 0; // disable descrambling
+ }
switch (st->codec->codec_id) {
case CODEC_ID_MP3:
st->codec->frame_size = MPA_FRAME_SIZE;
@@ -260,25 +260,25 @@
break;
}
} else {
- get_le32(pb);
+ get_le32(pb);
get_le32(pb);
get_byte(pb);
size = get_le16(pb); /* size */
sizeX= get_le32(pb); /* size */
st->codec->width = get_le32(pb);
- st->codec->height = get_le32(pb);
+ st->codec->height = get_le32(pb);
/* not available for asf */
get_le16(pb); /* panes */
- st->codec->bits_per_sample = get_le16(pb); /* depth */
+ st->codec->bits_per_sample = get_le16(pb); /* depth */
tag1 = get_le32(pb);
- url_fskip(pb, 20);
+ url_fskip(pb, 20);
// av_log(NULL, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX);
size= sizeX;
- if (size > 40) {
- st->codec->extradata_size = size - 40;
- st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
- }
+ if (size > 40) {
+ st->codec->extradata_size = size - 40;
+ st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
+ }
/* Extract palette from extradata if bpp <= 8 */
/* This code assumes that extradata contains only palette */
@@ -296,7 +296,7 @@
}
st->codec->codec_tag = tag1;
- st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
+ st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
if(tag1 == MKTAG('D', 'V', 'R', ' '))
st->need_parsing = 1;
}
@@ -316,7 +316,7 @@
get_str16_nolen(pb, len2, s->author, sizeof(s->author));
get_str16_nolen(pb, len3, s->copyright, sizeof(s->copyright));
get_str16_nolen(pb, len4, s->comment, sizeof(s->comment));
- url_fskip(pb, len5);
+ url_fskip(pb, len5);
} else if (!memcmp(&g, &extended_content_header, sizeof(GUID))) {
int desc_count, i;
@@ -399,10 +399,10 @@
fail:
for(i=0;i<s->nb_streams;i++) {
AVStream *st = s->streams[i];
- if (st) {
- av_free(st->priv_data);
+ if (st) {
+ av_free(st->priv_data);
av_free(st->codec->extradata);
- }
+ }
av_free(st);
}
return -1;
@@ -430,19 +430,19 @@
c = get_byte(pb);
if (c != 0x82) {
if (!url_feof(pb))
- av_log(s, AV_LOG_ERROR, "ff asf bad header %x at:%"PRId64"\n", c, url_ftell(pb));
+ av_log(s, AV_LOG_ERROR, "ff asf bad header %x at:%"PRId64"\n", c, url_ftell(pb));
}
if ((c & 0x0f) == 2) { // always true for now
- if (get_le16(pb) != 0) {
+ if (get_le16(pb) != 0) {
if (!url_feof(pb))
- av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
- return AVERROR_IO;
- }
+ av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
+ return AVERROR_IO;
+ }
rsize+=2;
/* }else{
if (!url_feof(pb))
- printf("ff asf bad header %x at:%lld\n", c, url_ftell(pb));
- return AVERROR_IO;*/
+ printf("ff asf bad header %x at:%lld\n", c, url_ftell(pb));
+ return AVERROR_IO;*/
}
asf->packet_flags = get_byte(pb);
@@ -457,10 +457,10 @@
// rsize has at least 11 bytes which have to be present
if (asf->packet_flags & 0x01) {
- asf->packet_segsizetype = get_byte(pb); rsize++;
+ asf->packet_segsizetype = get_byte(pb); rsize++;
asf->packet_segments = asf->packet_segsizetype & 0x3f;
} else {
- asf->packet_segments = 1;
+ asf->packet_segments = 1;
asf->packet_segsizetype = 0x80;
}
asf->packet_size_left = packet_length - padsize - rsize;
@@ -480,184 +480,184 @@
ByteIOContext *pb = &s->pb;
//static int pc = 0;
for (;;) {
- int rsize = 0;
- if (asf->packet_size_left < FRAME_HEADER_SIZE
- || asf->packet_segments < 1) {
- //asf->packet_size_left <= asf->packet_padsize) {
- int ret = asf->packet_size_left + asf->packet_padsize;
- //printf("PacketLeftSize:%d Pad:%d Pos:%Ld\n", asf->packet_size_left, asf->packet_padsize, url_ftell(pb));
+ int rsize = 0;
+ if (asf->packet_size_left < FRAME_HEADER_SIZE
+ || asf->packet_segments < 1) {
+ //asf->packet_size_left <= asf->packet_padsize) {
+ int ret = asf->packet_size_left + asf->packet_padsize;
+ //printf("PacketLeftSize:%d Pad:%d Pos:%Ld\n", asf->packet_size_left, asf->packet_padsize, url_ftell(pb));
if((url_ftell(&s->pb) + ret - s->data_offset) % asf->packet_size)
ret += asf->packet_size - ((url_ftell(&s->pb) + ret - s->data_offset) % asf->packet_size);
- /* fail safe */
- url_fskip(pb, ret);
+ /* fail safe */
+ url_fskip(pb, ret);
asf->packet_pos= url_ftell(&s->pb);
- ret = asf_get_packet(s);
- //printf("READ ASF PACKET %d r:%d c:%d\n", ret, asf->packet_size_left, pc++);
- if (ret < 0 || url_feof(pb))
- return AVERROR_IO;
+ ret = asf_get_packet(s);
+ //printf("READ ASF PACKET %d r:%d c:%d\n", ret, asf->packet_size_left, pc++);
+ if (ret < 0 || url_feof(pb))
+ return AVERROR_IO;
asf->packet_time_start = 0;
continue;
- }
- if (asf->packet_time_start == 0) {
- /* read frame header */
+ }
+ if (asf->packet_time_start == 0) {
+ /* read frame header */
int num = get_byte(pb);
- asf->packet_segments--;
- rsize++;
- asf->packet_key_frame = (num & 0x80) >> 7;
- asf->stream_index = asf->asfid2avid[num & 0x7f];
- // sequence should be ignored!
- DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0);
- DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0);
- DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
+ asf->packet_segments--;
+ rsize++;
+ asf->packet_key_frame = (num & 0x80) >> 7;
+ asf->stream_index = asf->asfid2avid[num & 0x7f];
+ // sequence should be ignored!
+ DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0);
+ DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0);
+ DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
//printf("key:%d stream:%d seq:%d offset:%d replic_size:%d\n", asf->packet_key_frame, asf->stream_index, asf->packet_seq, //asf->packet_frag_offset, asf->packet_replic_size);
- if (asf->packet_replic_size > 1) {
+ if (asf->packet_replic_size > 1) {
assert(asf->packet_replic_size >= 8);
// it should be always at least 8 bytes - FIXME validate
- asf->packet_obj_size = get_le32(pb);
- asf->packet_frag_timestamp = get_le32(pb); // timestamp
- if (asf->packet_replic_size > 8)
- url_fskip(pb, asf->packet_replic_size - 8);
- rsize += asf->packet_replic_size; // FIXME - check validity
- } else if (asf->packet_replic_size==1){
- // multipacket - frag_offset is begining timestamp
- asf->packet_time_start = asf->packet_frag_offset;
+ asf->packet_obj_size = get_le32(pb);
+ asf->packet_frag_timestamp = get_le32(pb); // timestamp
+ if (asf->packet_replic_size > 8)
+ url_fskip(pb, asf->packet_replic_size - 8);
+ rsize += asf->packet_replic_size; // FIXME - check validity
+ } else if (asf->packet_replic_size==1){
+ // multipacket - frag_offset is begining timestamp
+ asf->packet_time_start = asf->packet_frag_offset;
asf->packet_frag_offset = 0;
- asf->packet_frag_timestamp = asf->packet_timestamp;
+ asf->packet_frag_timestamp = asf->packet_timestamp;
asf->packet_time_delta = get_byte(pb);
- rsize++;
- }else{
+ rsize++;
+ }else{
assert(asf->packet_replic_size==0);
}
- if (asf->packet_flags & 0x01) {
- DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
+ if (asf->packet_flags & 0x01) {
+ DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
#undef DO_2BITS
- //printf("Fragsize %d\n", asf->packet_frag_size);
- } else {
- asf->packet_frag_size = asf->packet_size_left - rsize;
- //printf("Using rest %d %d %d\n", asf->packet_frag_size, asf->packet_size_left, rsize);
- }
- if (asf->packet_replic_size == 1) {
- asf->packet_multi_size = asf->packet_frag_size;
- if (asf->packet_multi_size > asf->packet_size_left) {
- asf->packet_segments = 0;
+ //printf("Fragsize %d\n", asf->packet_frag_size);
+ } else {
+ asf->packet_frag_size = asf->packet_size_left - rsize;
+ //printf("Using rest %d %d %d\n", asf->packet_frag_size, asf->packet_size_left, rsize);
+ }
+ if (asf->packet_replic_size == 1) {
+ asf->packet_multi_size = asf->packet_frag_size;
+ if (asf->packet_multi_size > asf->packet_size_left) {
+ asf->packet_segments = 0;
continue;
- }
- }
- asf->packet_size_left -= rsize;
- //printf("___objsize____ %d %d rs:%d\n", asf->packet_obj_size, asf->packet_frag_offset, rsize);
+ }
+ }
+ asf->packet_size_left -= rsize;
+ //printf("___objsize____ %d %d rs:%d\n", asf->packet_obj_size, asf->packet_frag_offset, rsize);
- if (asf->stream_index < 0
+ if (asf->stream_index < 0
|| s->streams[asf->stream_index]->discard >= AVDISCARD_ALL
|| (!asf->packet_key_frame && s->streams[asf->stream_index]->discard >= AVDISCARD_NONKEY)
) {
asf->packet_time_start = 0;
- /* unhandled packet (should not happen) */
- url_fskip(pb, asf->packet_frag_size);
- asf->packet_size_left -= asf->packet_frag_size;
+ /* unhandled packet (should not happen) */
+ url_fskip(pb, asf->packet_frag_size);
+ asf->packet_size_left -= asf->packet_frag_size;
if(asf->stream_index < 0)
av_log(s, AV_LOG_ERROR, "ff asf skip %d %d\n", asf->packet_frag_size, num & 0x7f);
continue;
- }
- asf->asf_st = s->streams[asf->stream_index]->priv_data;
- }
- asf_st = asf->asf_st;
+ }
+ asf->asf_st = s->streams[asf->stream_index]->priv_data;
+ }
+ asf_st = asf->asf_st;
- if ((asf->packet_frag_offset != asf_st->frag_offset
- || (asf->packet_frag_offset
- && asf->packet_seq != asf_st->seq)) // seq should be ignored
- ) {
- /* cannot continue current packet: free it */
- // FIXME better check if packet was already allocated
- av_log(s, AV_LOG_INFO, "ff asf parser skips: %d - %d o:%d - %d %d %d fl:%d\n",
- asf_st->pkt.size,
- asf->packet_obj_size,
- asf->packet_frag_offset, asf_st->frag_offset,
- asf->packet_seq, asf_st->seq, asf->packet_frag_size);
- if (asf_st->pkt.size)
- av_free_packet(&asf_st->pkt);
- asf_st->frag_offset = 0;
- if (asf->packet_frag_offset != 0) {
- url_fskip(pb, asf->packet_frag_size);
- av_log(s, AV_LOG_INFO, "ff asf parser skipping %db\n", asf->packet_frag_size);
- asf->packet_size_left -= asf->packet_frag_size;
- continue;
- }
- }
- if (asf->packet_replic_size == 1) {
- // frag_offset is here used as the begining timestamp
- asf->packet_frag_timestamp = asf->packet_time_start;
- asf->packet_time_start += asf->packet_time_delta;
- asf->packet_obj_size = asf->packet_frag_size = get_byte(pb);
- asf->packet_size_left--;
+ if ((asf->packet_frag_offset != asf_st->frag_offset
+ || (asf->packet_frag_offset
+ && asf->packet_seq != asf_st->seq)) // seq should be ignored
+ ) {
+ /* cannot continue current packet: free it */
+ // FIXME better check if packet was already allocated
+ av_log(s, AV_LOG_INFO, "ff asf parser skips: %d - %d o:%d - %d %d %d fl:%d\n",
+ asf_st->pkt.size,
+ asf->packet_obj_size,
+ asf->packet_frag_offset, asf_st->frag_offset,
+ asf->packet_seq, asf_st->seq, asf->packet_frag_size);
+ if (asf_st->pkt.size)
+ av_free_packet(&asf_st->pkt);
+ asf_st->frag_offset = 0;
+ if (asf->packet_frag_offset != 0) {
+ url_fskip(pb, asf->packet_frag_size);
+ av_log(s, AV_LOG_INFO, "ff asf parser skipping %db\n", asf->packet_frag_size);
+ asf->packet_size_left -= asf->packet_frag_size;
+ continue;
+ }
+ }
+ if (asf->packet_replic_size == 1) {
+ // frag_offset is here used as the begining timestamp
+ asf->packet_frag_timestamp = asf->packet_time_start;
+ asf->packet_time_start += asf->packet_time_delta;
+ asf->packet_obj_size = asf->packet_frag_size = get_byte(pb);
+ asf->packet_size_left--;
asf->packet_multi_size--;
- if (asf->packet_multi_size < asf->packet_obj_size)
- {
- asf->packet_time_start = 0;
- url_fskip(pb, asf->packet_multi_size);
- asf->packet_size_left -= asf->packet_multi_size;
+ if (asf->packet_multi_size < asf->packet_obj_size)
+ {
+ asf->packet_time_start = 0;
+ url_fskip(pb, asf->packet_multi_size);
+ asf->packet_size_left -= asf->packet_multi_size;
continue;
- }
- asf->packet_multi_size -= asf->packet_obj_size;
- //printf("COMPRESS size %d %d %d ms:%d\n", asf->packet_obj_size, asf->packet_frag_timestamp, asf->packet_size_left, asf->packet_multi_size);
- }
- if (asf_st->frag_offset == 0) {
- /* new packet */
- av_new_packet(&asf_st->pkt, asf->packet_obj_size);
- asf_st->seq = asf->packet_seq;
- asf_st->pkt.pts = asf->packet_frag_timestamp;
- asf_st->pkt.stream_index = asf->stream_index;
+ }
+ asf->packet_multi_size -= asf->packet_obj_size;
+ //printf("COMPRESS size %d %d %d ms:%d\n", asf->packet_obj_size, asf->packet_frag_timestamp, asf->packet_size_left, asf->packet_multi_size);
+ }
+ if (asf_st->frag_offset == 0) {
+ /* new packet */
+ av_new_packet(&asf_st->pkt, asf->packet_obj_size);
+ asf_st->seq = asf->packet_seq;
+ asf_st->pkt.pts = asf->packet_frag_timestamp;
+ asf_st->pkt.stream_index = asf->stream_index;
asf_st->pkt.pos =
asf_st->packet_pos= asf->packet_pos;
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & PKT_FLAG_KEY,
//s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO, asf->packet_obj_size);
- if (s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO)
- asf->packet_key_frame = 1;
- if (asf->packet_key_frame)
- asf_st->pkt.flags |= PKT_FLAG_KEY;
- }
+ if (s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO)
+ asf->packet_key_frame = 1;
+ if (asf->packet_key_frame)
+ asf_st->pkt.flags |= PKT_FLAG_KEY;
+ }
- /* read data */
- //printf("READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n",
- // asf->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
- // asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
- asf->packet_size_left -= asf->packet_frag_size;
- if (asf->packet_size_left < 0)
+ /* read data */
+ //printf("READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n",
+ // asf->packet_size, asf_st->pkt.size, asf->packet_frag_offset,
+ // asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data);
+ asf->packet_size_left -= asf->packet_frag_size;
+ if (asf->packet_size_left < 0)
continue;
- get_buffer(pb, asf_st->pkt.data + asf->packet_frag_offset,
- asf->packet_frag_size);
- asf_st->frag_offset += asf->packet_frag_size;
- /* test if whole packet is read */
- if (asf_st->frag_offset == asf_st->pkt.size) {
- /* return packet */
- if (asf_st->ds_span > 1) {
- /* packet descrambling */
- char* newdata = av_malloc(asf_st->pkt.size);
- if (newdata) {
- int offset = 0;
- while (offset < asf_st->pkt.size) {
- int off = offset / asf_st->ds_chunk_size;
- int row = off / asf_st->ds_span;
- int col = off % asf_st->ds_span;
- int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size;
- //printf("off:%d row:%d col:%d idx:%d\n", off, row, col, idx);
- memcpy(newdata + offset,
- asf_st->pkt.data + idx * asf_st->ds_chunk_size,
- asf_st->ds_chunk_size);
- offset += asf_st->ds_chunk_size;
- }
- av_free(asf_st->pkt.data);
- asf_st->pkt.data = newdata;
- }
- }
- asf_st->frag_offset = 0;
- memcpy(pkt, &asf_st->pkt, sizeof(AVPacket));
- //printf("packet %d %d\n", asf_st->pkt.size, asf->packet_frag_size);
- asf_st->pkt.size = 0;
- asf_st->pkt.data = 0;
- break; // packet completed
- }
+ get_buffer(pb, asf_st->pkt.data + asf->packet_frag_offset,
+ asf->packet_frag_size);
+ asf_st->frag_offset += asf->packet_frag_size;
+ /* test if whole packet is read */
+ if (asf_st->frag_offset == asf_st->pkt.size) {
+ /* return packet */
+ if (asf_st->ds_span > 1) {
+ /* packet descrambling */
+ char* newdata = av_malloc(asf_st->pkt.size);
+ if (newdata) {
+ int offset = 0;
+ while (offset < asf_st->pkt.size) {
+ int off = offset / asf_st->ds_chunk_size;
+ int row = off / asf_st->ds_span;
+ int col = off % asf_st->ds_span;
+ int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size;
+ //printf("off:%d row:%d col:%d idx:%d\n", off, row, col, idx);
+ memcpy(newdata + offset,
+ asf_st->pkt.data + idx * asf_st->ds_chunk_size,
+ asf_st->ds_chunk_size);
+ offset += asf_st->ds_chunk_size;
+ }
+ av_free(asf_st->pkt.data);
+ asf_st->pkt.data = newdata;
+ }
+ }
+ asf_st->frag_offset = 0;
+ memcpy(pkt, &asf_st->pkt, sizeof(AVPacket));
+ //printf("packet %d %d\n", asf_st->pkt.size, asf->packet_frag_size);
+ asf_st->pkt.size = 0;
+ asf_st->pkt.data = 0;
+ break; // packet completed
+ }
}
return 0;
}
@@ -667,9 +667,9 @@
int i;
for(i=0;i<s->nb_streams;i++) {
- AVStream *st = s->streams[i];
- av_free(st->priv_data);
- av_free(st->codec->extradata);
+ AVStream *st = s->streams[i];
+ av_free(st->priv_data);
+ av_free(st->codec->extradata);
av_free(st->codec->palctrl);
}
return 0;
@@ -738,7 +738,7 @@
for(;;){
if (av_read_frame(s, pkt) < 0){
av_log(s, AV_LOG_INFO, "seek failed\n");
- return AV_NOPTS_VALUE;
+ return AV_NOPTS_VALUE;
}
pts= pkt->pts * 1000 / AV_TIME_BASE;
Index: asf.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/asf.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- asf.h 17 Dec 2005 18:14:36 -0000 1.67
+++ asf.h 22 Dec 2005 01:10:10 -0000 1.68
@@ -26,7 +26,7 @@
int timestamp;
int64_t duration;
- int ds_span; /* descrambling */
+ int ds_span; /* descrambling */
int ds_packet_size;
int ds_chunk_size;
int ds_data_size;
@@ -44,29 +44,29 @@
} GUID;
typedef struct {
- GUID guid; // generated by client computer
- uint64_t file_size; // in bytes
+ GUID guid; // generated by client computer
+ uint64_t file_size; // in bytes
// invalid if broadcasting
- uint64_t create_time; // time of creation, in 100-nanosecond units since 1.1.1601
+ uint64_t create_time; // time of creation, in 100-nanosecond units since 1.1.1601
// invalid if broadcasting
- uint64_t packets_count; // how many packets are there in the file
+ uint64_t packets_count; // how many packets are there in the file
// invalid if broadcasting
- uint64_t play_time; // play time, in 100-nanosecond units
+ uint64_t play_time; // play time, in 100-nanosecond units
// invalid if broadcasting
- uint64_t send_time; // time to send file, in 100-nanosecond units
+ uint64_t send_time; // time to send file, in 100-nanosecond units
// invalid if broadcasting (could be ignored)
- uint32_t preroll; // timestamp of the first packet, in milliseconds
- // if nonzero - substract from time
+ uint32_t preroll; // timestamp of the first packet, in milliseconds
+ // if nonzero - substract from time
uint32_t ignore; // preroll is 64bit - but let's just ignore it
- uint32_t flags; // 0x01 - broadcast
- // 0x02 - seekable
+ uint32_t flags; // 0x01 - broadcast
+ // 0x02 - seekable
// rest is reserved should be 0
- uint32_t min_pktsize; // size of a data packet
+ uint32_t min_pktsize; // size of a data packet
// invalid if broadcasting
- uint32_t max_pktsize; // shall be the same as for min_pktsize
+ uint32_t max_pktsize; // shall be the same as for min_pktsize
// invalid if broadcasting
- uint32_t max_bitrate; // bandwith of stream in bps
- // should be the sum of bitrates of the
+ uint32_t max_bitrate; // bandwith of stream in bps
+ // should be the sum of bitrates of the
// individual media streams
} ASFMainHeader;
@@ -82,7 +82,7 @@
unsigned int packet_size;
int is_streamed;
int asfid2avid[128]; /* conversion table from asf ID 2 AVStream ID */
- ASFStream streams[128]; /* it's max number and it's not that big */
+ ASFStream streams[128]; /* it's max number and it's not that big */
/* non streamed additonnal info */
int64_t nb_packets;
int64_t duration; /* in 100ns units */
Index: audio.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/audio.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- audio.c 17 Dec 2005 18:14:36 -0000 1.26
+++ audio.c 22 Dec 2005 01:10:10 -0000 1.27
@@ -54,7 +54,7 @@
/* open linux audio device */
if (!audio_device)
#ifdef __OpenBSD__
- audio_device = "/dev/sound";
+ audio_device = "/dev/sound";
#else
audio_device = "/dev/dsp";
#endif
Index: avformat.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/avformat.h,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- avformat.h 17 Dec 2005 18:14:36 -0000 1.136
+++ avformat.h 22 Dec 2005 01:10:10 -0000 1.137
@@ -68,7 +68,7 @@
static inline void av_free_packet(AVPacket *pkt)
{
if (pkt && pkt->destruct) {
- pkt->destruct(pkt);
+ pkt->destruct(pkt);
}
}
Index: avi.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/avi.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- avi.h 17 Dec 2005 18:14:36 -0000 1.16
+++ avi.h 22 Dec 2005 01:10:11 -0000 1.17
@@ -3,12 +3,12 @@
#include "avcodec.h"
-#define AVIF_HASINDEX 0x00000010 // Index at end of file?
-#define AVIF_MUSTUSEINDEX 0x00000020
-#define AVIF_ISINTERLEAVED 0x00000100
-#define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames?
-#define AVIF_WASCAPTUREFILE 0x00010000
-#define AVIF_COPYRIGHTED 0x00020000
+#define AVIF_HASINDEX 0x00000010 // Index at end of file?
+#define AVIF_MUSTUSEINDEX 0x00000020
+#define AVIF_ISINTERLEAVED 0x00000100
+#define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames?
+#define AVIF_WASCAPTUREFILE 0x00010000
+#define AVIF_COPYRIGHTED 0x00020000
#define AVI_MAX_RIFF_SIZE 0x40000000LL
#define AVI_MASTER_INDEX_SIZE 256
Index: avidec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/avidec.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- avidec.c 17 Dec 2005 18:14:36 -0000 1.77
+++ avidec.c 22 Dec 2005 01:10:11 -0000 1.78
@@ -133,15 +133,15 @@
}
break;
case MKTAG('d', 'm', 'l', 'h'):
- avi->is_odml = 1;
- url_fskip(pb, size + (size & 1));
- break;
+ avi->is_odml = 1;
+ url_fskip(pb, size + (size & 1));
+ break;
case MKTAG('a', 'v', 'i', 'h'):
- /* avi header */
+ /* avi header */
/* using frame_period is bad idea */
frame_period = get_le32(pb);
bit_rate = get_le32(pb) * 8;
- url_fskip(pb, 4 * 4);
+ url_fskip(pb, 4 * 4);
n = get_le32(pb);
for(i=0;i<n;i++) {
AVIStream *ast;
@@ -153,7 +153,7 @@
if (!ast)
goto fail;
st->priv_data = ast;
- }
+ }
url_fskip(pb, size - 7 * 4);
break;
case MKTAG('s', 't', 'r', 'h'):
@@ -166,30 +166,30 @@
#endif
if(tag1 == MKTAG('i', 'a', 'v', 's') || tag1 == MKTAG('i', 'v', 'a', 's')){
/*
- * After some consideration -- I don't think we
- * have to support anything but DV in a type1 AVIs.
- */
- if (s->nb_streams != 1)
- goto fail;
+ * After some consideration -- I don't think we
+ * have to support anything but DV in a type1 AVIs.
+ */
+ if (s->nb_streams != 1)
+ goto fail;
- if (handler != MKTAG('d', 'v', 's', 'd') &&
- handler != MKTAG('d', 'v', 'h', 'd') &&
- handler != MKTAG('d', 'v', 's', 'l'))
- goto fail;
+ if (handler != MKTAG('d', 'v', 's', 'd') &&
+ handler != MKTAG('d', 'v', 'h', 'd') &&
+ handler != MKTAG('d', 'v', 's', 'l'))
+ goto fail;
- ast = s->streams[0]->priv_data;
- av_freep(&s->streams[0]->codec->extradata);
- av_freep(&s->streams[0]);
- s->nb_streams = 0;
- avi->dv_demux = dv_init_demux(s);
- if (!avi->dv_demux)
- goto fail;
- s->streams[0]->priv_data = ast;
- url_fskip(pb, 3 * 4);
- ast->scale = get_le32(pb);
- ast->rate = get_le32(pb);
- stream_index = s->nb_streams - 1;
- url_fskip(pb, size - 7*4);
+ ast = s->streams[0]->priv_data;
+ av_freep(&s->streams[0]->codec->extradata);
+ av_freep(&s->streams[0]);
+ s->nb_streams = 0;
+ avi->dv_demux = dv_init_demux(s);
+ if (!avi->dv_demux)
+ goto fail;
+ s->streams[0]->priv_data = ast;
+ url_fskip(pb, 3 * 4);
+ ast->scale = get_le32(pb);
+ ast->rate = get_le32(pb);
+ stream_index = s->nb_streams - 1;
+ url_fskip(pb, size - 7*4);
break;
}
@@ -228,7 +228,7 @@
// av_log(NULL, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size);
switch(tag1) {
- case MKTAG('v', 'i', 'd', 's'):
+ case MKTAG('v', 'i', 'd', 's'):
codec_type = CODEC_TYPE_VIDEO;
ast->sample_size = 0;
@@ -361,8 +361,8 @@
if (avi->dv_demux) {
size = dv_get_packet(avi->dv_demux, pkt);
- if (size >= 0)
- return size;
+ if (size >= 0)
+ return size;
}
if(avi->non_interleaved){
@@ -483,13 +483,13 @@
for(i=sync=url_ftell(pb); !url_feof(pb); i++) {
int j;
- if (i >= avi->movi_end) {
- if (avi->is_odml) {
- url_fskip(pb, avi->riff_end - i);
- avi->riff_end = avi->movi_end = url_fsize(pb);
- } else
- break;
- }
+ if (i >= avi->movi_end) {
+ if (avi->is_odml) {
+ url_fskip(pb, avi->riff_end - i);
+ avi->riff_end = avi->movi_end = url_fsize(pb);
+ } else
+ break;
+ }
for(j=0; j<7; j++)
d[j]= d[j+1];
@@ -509,7 +509,7 @@
//parse ix##
if( (d[0] == 'i' && d[1] == 'x' && n < s->nb_streams)
- //parse JUNK
+ //parse JUNK
||(d[0] == 'J' && d[1] == 'U' && d[2] == 'N' && d[3] == 'K')){
url_fskip(pb, size);
//av_log(NULL, AV_LOG_DEBUG, "SKIP\n");
@@ -542,7 +542,7 @@
if( ((ast->prefix_count<5 || sync+9 > i) && d[2]<128 && d[3]<128) ||
d[2]*256+d[3] == ast->prefix /*||
(d[2] == 'd' && d[3] == 'c') ||
- (d[2] == 'w' && d[3] == 'b')*/) {
+ (d[2] == 'w' && d[3] == 'b')*/) {
//av_log(NULL, AV_LOG_DEBUG, "OK\n");
if(d[2]*256+d[3] == ast->prefix)
@@ -571,8 +571,8 @@
first = get_byte(pb);
clr = get_byte(pb);
- if(!clr) /* all 256 colors used */
- clr = 256;
+ if(!clr) /* all 256 colors used */
+ clr = 256;
flags = get_le16(pb);
p = 4;
for (k = first; k < clr + first; k++) {
Index: avienc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/avienc.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- avienc.c 17 Dec 2005 18:14:36 -0000 1.116
+++ avienc.c 22 Dec 2005 01:10:11 -0000 1.117
@@ -357,14 +357,14 @@
if(video_enc){
put_le32(pb, (uint32_t)(int64_t_C(1000000) * video_enc->time_base.num / video_enc->time_base.den));
} else {
- put_le32(pb, 0);
+ put_le32(pb, 0);
}
put_le32(pb, bitrate / 8); /* XXX: not quite exact */
put_le32(pb, 0); /* padding */
if (url_is_streamed(pb))
- put_le32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */
+ put_le32(pb, AVIF_TRUSTCKTYPE | AVIF_ISINTERLEAVED); /* flags */
else
- put_le32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
+ put_le32(pb, AVIF_TRUSTCKTYPE | AVIF_HASINDEX | AVIF_ISINTERLEAVED); /* flags */
avi->frames_hdr_all = url_ftell(pb); /* remember this offset to fill later */
put_le32(pb, nb_frames); /* nb frames, filled later */
put_le32(pb, 0); /* initial frame */
@@ -374,8 +374,8 @@
put_le32(pb, video_enc->width);
put_le32(pb, video_enc->height);
} else {
- put_le32(pb, 0);
- put_le32(pb, 0);
+ put_le32(pb, 0);
+ put_le32(pb, 0);
}
put_le32(pb, 0); /* reserved */
put_le32(pb, 0); /* reserved */
@@ -419,10 +419,10 @@
put_le32(pb, 0); /* start */
avi->frames_hdr_strm[i] = url_ftell(pb); /* remember this offset to fill later */
- if (url_is_streamed(pb))
- put_le32(pb, AVI_MAX_RIFF_SIZE); /* FIXME: this may be broken, but who cares */
- else
- put_le32(pb, 0); /* length, XXX: filled later */
+ if (url_is_streamed(pb))
+ put_le32(pb, AVI_MAX_RIFF_SIZE); /* FIXME: this may be broken, but who cares */
+ else
+ put_le32(pb, 0); /* length, XXX: filled later */
/* suggested buffer size */ //FIXME set at the end to largest chunk
if(stream->codec_type == CODEC_TYPE_VIDEO)
@@ -442,7 +442,7 @@
strf = start_tag(pb, "strf");
switch(stream->codec_type) {
case CODEC_TYPE_VIDEO:
- put_bmp_header(pb, stream, codec_bmp_tags, 0);
+ put_bmp_header(pb, stream, codec_bmp_tags, 0);
break;
case CODEC_TYPE_AUDIO:
if (put_wav_header(pb, stream) < 0) {
@@ -456,29 +456,29 @@
end_tag(pb, strf);
}
- if (!url_is_streamed(pb)) {
- unsigned char tag[5];
- int j;
+ if (!url_is_streamed(pb)) {
+ unsigned char tag[5];
+ int j;
/* Starting to lay out AVI OpenDML master index.
- * We want to make it JUNK entry for now, since we'd
- * like to get away without making AVI an OpenDML one
- * for compatibility reasons.
- */
- avi->indexes[i].entry = avi->indexes[i].ents_allocated = 0;
- avi->indexes[i].indx_start = start_tag(pb, "JUNK");
- put_le16(pb, 4); /* wLongsPerEntry */
- put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
- put_byte(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
- put_le32(pb, 0); /* nEntriesInUse (will fill out later on) */
- put_tag(pb, avi_stream2fourcc(&tag[0], i, stream->codec_type));
- /* dwChunkId */
- put_le64(pb, 0); /* dwReserved[3]
- put_le32(pb, 0); Must be 0. */
- for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++)
- put_le64(pb, 0);
- end_tag(pb, avi->indexes[i].indx_start);
- }
+ * We want to make it JUNK entry for now, since we'd
+ * like to get away without making AVI an OpenDML one
+ * for compatibility reasons.
+ */
+ avi->indexes[i].entry = avi->indexes[i].ents_allocated = 0;
+ avi->indexes[i].indx_start = start_tag(pb, "JUNK");
+ put_le16(pb, 4); /* wLongsPerEntry */
+ put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
+ put_byte(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
+ put_le32(pb, 0); /* nEntriesInUse (will fill out later on) */
+ put_tag(pb, avi_stream2fourcc(&tag[0], i, stream->codec_type));
+ /* dwChunkId */
+ put_le64(pb, 0); /* dwReserved[3]
+ put_le32(pb, 0); Must be 0. */
+ for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++)
+ put_le64(pb, 0);
+ end_tag(pb, avi->indexes[i].indx_start);
+ }
end_tag(pb, list2);
}
@@ -513,51 +513,51 @@
int i, j;
if (url_is_streamed(pb))
- return -1;
+ return -1;
if (avi->riff_id > AVI_MASTER_INDEX_SIZE)
return -1;
for (i=0;i<s->nb_streams;i++) {
- offset_t ix, pos;
+ offset_t ix, pos;
- avi_stream2fourcc(&tag[0], i, s->streams[i]->codec->codec_type);
- ix_tag[3] = '0' + i;
+ avi_stream2fourcc(&tag[0], i, s->streams[i]->codec->codec_type);
+ ix_tag[3] = '0' + i;
- /* Writing AVI OpenDML leaf index chunk */
- ix = url_ftell(pb);
- put_tag(pb, &ix_tag[0]); /* ix?? */
- put_le32(pb, avi->indexes[i].entry * 8 + 24);
- /* chunk size */
+ /* Writing AVI OpenDML leaf index chunk */
+ ix = url_ftell(pb);
+ put_tag(pb, &ix_tag[0]); /* ix?? */
+ put_le32(pb, avi->indexes[i].entry * 8 + 24);
+ /* chunk size */
put_le16(pb, 2); /* wLongsPerEntry */
- put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
- put_byte(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
- put_le32(pb, avi->indexes[i].entry);
- /* nEntriesInUse */
- put_tag(pb, &tag[0]); /* dwChunkId */
- put_le64(pb, avi->movi_list);/* qwBaseOffset */
- put_le32(pb, 0); /* dwReserved_3 (must be 0) */
+ put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
+ put_byte(pb, 1); /* bIndexType (1 == AVI_INDEX_OF_CHUNKS) */
+ put_le32(pb, avi->indexes[i].entry);
+ /* nEntriesInUse */
+ put_tag(pb, &tag[0]); /* dwChunkId */
+ put_le64(pb, avi->movi_list);/* qwBaseOffset */
+ put_le32(pb, 0); /* dwReserved_3 (must be 0) */
for (j=0; j<avi->indexes[i].entry; j++) {
AVIIentry* ie = avi_get_ientry(&avi->indexes[i], j);
- put_le32(pb, ie->pos + 8);
- put_le32(pb, ((uint32_t)ie->len & ~0x80000000) |
- (ie->flags & 0x10 ? 0 : 0x80000000));
+ put_le32(pb, ie->pos + 8);
+ put_le32(pb, ((uint32_t)ie->len & ~0x80000000) |
+ (ie->flags & 0x10 ? 0 : 0x80000000));
}
- put_flush_packet(pb);
+ put_flush_packet(pb);
pos = url_ftell(pb);
- /* Updating one entry in the AVI OpenDML master index */
- url_fseek(pb, avi->indexes[i].indx_start - 8, SEEK_SET);
- put_tag(pb, "indx"); /* enabling this entry */
- url_fskip(pb, 8);
- put_le32(pb, avi->riff_id); /* nEntriesInUse */
- url_fskip(pb, 16*avi->riff_id);
- put_le64(pb, ix); /* qwOffset */
- put_le32(pb, pos - ix); /* dwSize */
- put_le32(pb, avi->indexes[i].entry); /* dwDuration */
+ /* Updating one entry in the AVI OpenDML master index */
+ url_fseek(pb, avi->indexes[i].indx_start - 8, SEEK_SET);
+ put_tag(pb, "indx"); /* enabling this entry */
+ url_fskip(pb, 8);
+ put_le32(pb, avi->riff_id); /* nEntriesInUse */
+ url_fskip(pb, 16*avi->riff_id);
+ put_le64(pb, ix); /* qwOffset */
+ put_le32(pb, pos - ix); /* dwSize */
+ put_le32(pb, avi->indexes[i].entry); /* dwDuration */
- url_fseek(pb, pos, SEEK_SET);
+ url_fseek(pb, pos, SEEK_SET);
}
return 0;
}
@@ -572,39 +572,39 @@
unsigned char tag[5];
if (!url_is_streamed(pb)) {
- AVIIentry* ie = 0, *tie;
- int entry[MAX_STREAMS];
- int empty, stream_id = -1;
+ AVIIentry* ie = 0, *tie;
+ int entry[MAX_STREAMS];
+ int empty, stream_id = -1;
- idx_chunk = start_tag(pb, "idx1");
- memset(&entry[0], 0, sizeof(entry));
- do {
- empty = 1;
- for (i=0; i<s->nb_streams; i++) {
- if (avi->indexes[i].entry <= entry[i])
- continue;
+ idx_chunk = start_tag(pb, "idx1");
+ memset(&entry[0], 0, sizeof(entry));
+ do {
+ empty = 1;
+ for (i=0; i<s->nb_streams; i++) {
+ if (avi->indexes[i].entry <= entry[i])
+ continue;
- tie = avi_get_ientry(&avi->indexes[i], entry[i]);
- if (empty || tie->pos < ie->pos) {
- ie = tie;
- stream_id = i;
- }
- empty = 0;
- }
- if (!empty) {
- avi_stream2fourcc(&tag[0], stream_id,
- s->streams[stream_id]->codec->codec_type);
- put_tag(pb, &tag[0]);
- put_le32(pb, ie->flags);
+ tie = avi_get_ientry(&avi->indexes[i], entry[i]);
+ if (empty || tie->pos < ie->pos) {
+ ie = tie;
+ stream_id = i;
+ }
+ empty = 0;
+ }
+ if (!empty) {
+ avi_stream2fourcc(&tag[0], stream_id,
+ s->streams[stream_id]->codec->codec_type);
+ put_tag(pb, &tag[0]);
+ put_le32(pb, ie->flags);
put_le32(pb, ie->pos);
put_le32(pb, ie->len);
- entry[stream_id]++;
- }
- } while (!empty);
- end_tag(pb, idx_chunk);
+ entry[stream_id]++;
+ }
+ } while (!empty);
+ end_tag(pb, idx_chunk);
/* Fill in frame/sample counters */
- file_size = url_ftell(pb);
+ file_size = url_ftell(pb);
nb_frames = 0;
for(n=0;n<s->nb_streams;n++) {
if (avi->frames_hdr_strm[n] != 0) {
@@ -653,16 +653,16 @@
// Make sure to put an OpenDML chunk when the file size exceeds the limits
if (!url_is_streamed(pb) &&
- (url_ftell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {
+ (url_ftell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {
avi_write_ix(s);
end_tag(pb, avi->movi_list);
- if (avi->riff_id == 1)
- avi_write_idx1(s);
+ if (avi->riff_id == 1)
+ avi_write_idx1(s);
- end_tag(pb, avi->riff_start);
- avi->movi_list = avi_start_new_riff(avi, pb, "AVIX", "movi");
+ end_tag(pb, avi->riff_start);
+ avi->movi_list = avi_start_new_riff(avi, pb, "AVIX", "movi");
}
avi_stream2fourcc(&tag[0], stream_index, enc->codec_type);
@@ -674,22 +674,22 @@
if (!url_is_streamed(&s->pb)) {
AVIIndex* idx = &avi->indexes[stream_index];
- int cl = idx->entry / AVI_INDEX_CLUSTER_SIZE;
- int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
+ int cl = idx->entry / AVI_INDEX_CLUSTER_SIZE;
+ int id = idx->entry % AVI_INDEX_CLUSTER_SIZE;
if (idx->ents_allocated <= idx->entry) {
- idx->cluster = av_realloc(idx->cluster, (cl+1)*sizeof(void*));
- if (!idx->cluster)
- return -1;
+ idx->cluster = av_realloc(idx->cluster, (cl+1)*sizeof(void*));
+ if (!idx->cluster)
+ return -1;
idx->cluster[cl] = av_malloc(AVI_INDEX_CLUSTER_SIZE*sizeof(AVIIentry));
- if (!idx->cluster[cl])
- return -1;
- idx->ents_allocated += AVI_INDEX_CLUSTER_SIZE;
- }
+ if (!idx->cluster[cl])
+ return -1;
+ idx->ents_allocated += AVI_INDEX_CLUSTER_SIZE;
+ }
- idx->cluster[cl][id].flags = flags;
+ idx->cluster[cl][id].flags = flags;
idx->cluster[cl][id].pos = url_ftell(pb) - avi->movi_list;
idx->cluster[cl][id].len = size;
- idx->entry++;
+ idx->entry++;
}
put_buffer(pb, tag, 4);
@@ -715,16 +715,16 @@
if (avi->riff_id == 1) {
end_tag(pb, avi->movi_list);
res = avi_write_idx1(s);
- end_tag(pb, avi->riff_start);
+ end_tag(pb, avi->riff_start);
} else {
avi_write_ix(s);
end_tag(pb, avi->movi_list);
- end_tag(pb, avi->riff_start);
+ end_tag(pb, avi->riff_start);
file_size = url_ftell(pb);
- url_fseek(pb, avi->odml_list - 8, SEEK_SET);
- put_tag(pb, "LIST"); /* Making this AVI OpenDML one */
- url_fskip(pb, 16);
+ url_fseek(pb, avi->odml_list - 8, SEEK_SET);
+ put_tag(pb, "LIST"); /* Making this AVI OpenDML one */
+ url_fskip(pb, 16);
for (n=nb_frames=0;n<s->nb_streams;n++) {
AVCodecContext *stream = s->streams[n]->codec;
@@ -737,18 +737,18 @@
}
}
}
- put_le32(pb, nb_frames);
- url_fseek(pb, file_size, SEEK_SET);
+ put_le32(pb, nb_frames);
+ url_fseek(pb, file_size, SEEK_SET);
}
}
put_flush_packet(pb);
for (i=0; i<MAX_STREAMS; i++) {
- for (j=0; j<avi->indexes[i].ents_allocated/AVI_INDEX_CLUSTER_SIZE; j++)
+ for (j=0; j<avi->indexes[i].ents_allocated/AVI_INDEX_CLUSTER_SIZE; j++)
av_free(avi->indexes[i].cluster[j]);
- av_free(avi->indexes[i].cluster);
- avi->indexes[i].cluster = NULL;
- avi->indexes[i].ents_allocated = avi->indexes[i].entry = 0;
+ av_free(avi->indexes[i].cluster);
+ avi->indexes[i].cluster = NULL;
+ avi->indexes[i].ents_allocated = avi->indexes[i].entry = 0;
}
return res;
Index: aviobuf.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/aviobuf.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- aviobuf.c 17 Dec 2005 18:14:36 -0000 1.32
+++ aviobuf.c 22 Dec 2005 01:10:11 -0000 1.33
@@ -470,7 +470,7 @@
return url_write(h, buf, buf_size);
}
#else
-#define url_write_packet NULL
+#define url_write_packet NULL
#endif //CONFIG_MUXERS
static int url_read_packet(void *opaque, uint8_t *buf, int buf_size)
Index: barpainet.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/barpainet.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- barpainet.c 17 Dec 2005 18:14:36 -0000 1.2
+++ barpainet.c 22 Dec 2005 01:10:11 -0000 1.3
@@ -4,22 +4,22 @@
#include "barpainet.h"
int inet_aton (const char * str, struct in_addr * add) {
- const char * pch = str;
- unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
+ const char * pch = str;
+ unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
- add1 = atoi(pch);
- pch = strpbrk(pch,".");
- if (pch == 0 || ++pch == 0) goto done;
- add2 = atoi(pch);
- pch = strpbrk(pch,".");
- if (pch == 0 || ++pch == 0) goto done;
- add3 = atoi(pch);
- pch = strpbrk(pch,".");
- if (pch == 0 || ++pch == 0) goto done;
- add4 = atoi(pch);
+ add1 = atoi(pch);
+ pch = strpbrk(pch,".");
+ if (pch == 0 || ++pch == 0) goto done;
+ add2 = atoi(pch);
+ pch = strpbrk(pch,".");
+ if (pch == 0 || ++pch == 0) goto done;
+ add3 = atoi(pch);
+ pch = strpbrk(pch,".");
+ if (pch == 0 || ++pch == 0) goto done;
+ add4 = atoi(pch);
done:
- add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
+ add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
- return 1;
+ return 1;
}
Index: cutils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/cutils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cutils.c 17 Dec 2005 18:14:36 -0000 1.7
+++ cutils.c 22 Dec 2005 01:10:11 -0000 1.8
@@ -59,7 +59,7 @@
p = str;
q = val;
while (*q != '\0') {
- if (toupper(*(const unsigned char *)p) != toupper(*(const unsigned char *)q))
+ if (toupper(*(const unsigned char *)p) != toupper(*(const unsigned char *)q))
return 0;
p++;
q++;
@@ -166,13 +166,13 @@
/* oh well, may be someone some day will invent a formula for this stuff */
y = 1970; /* start "guessing" */
while (days >= (ISLEAP(y)?366:365)) {
- ny = (y + days/366);
- days -= (ny - y) * 365 + LEAPS_COUNT(ny - 1) - LEAPS_COUNT(y - 1);
- y = ny;
+ ny = (y + days/366);
+ days -= (ny - y) * 365 + LEAPS_COUNT(ny - 1) - LEAPS_COUNT(y - 1);
+ y = ny;
}
md[1] = ISLEAP(y)?29:28;
for (m=0; days >= md[m]; m++)
- days -= md[m];
+ days -= md[m];
tm->tm_year = y; /* unlike gmtime_r we store complete year here */
tm->tm_mon = m+1; /* unlike gmtime_r tm_mon is from 1 to 12 */
Index: dc1394.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/dc1394.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dc1394.c 17 Dec 2005 18:14:36 -0000 1.5
+++ dc1394.c 22 Dec 2005 01:10:11 -0000 1.6
@@ -69,16 +69,16 @@
for (fmt = dc1394_frame_formats; fmt->width; fmt++)
if (fmt->pix_fmt == ap->pix_fmt && fmt->width == ap->width && fmt->height == ap->height)
- break;
+ break;
for (fps = dc1394_frame_rates; fps->frame_rate; fps++)
if (fps->frame_rate == av_rescale(1000, ap->time_base.den, ap->time_base.num))
- break;
+ break;
/* create a video stream */
vst = av_new_stream(c, 0);
if (!vst)
- return -1;
+ return -1;
av_set_pts_info(vst, 64, 1, 1000);
vst->codec->codec_type = CODEC_TYPE_VIDEO;
vst->codec->codec_id = CODEC_ID_RAWVIDEO;
@@ -102,7 +102,7 @@
/* Now lets prep the hardware */
dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
if (!dc1394->handle) {
- av_log(c, AV_LOG_ERROR, "Can't acquire dc1394 handle on port %d\n", 0 /* ap->port */);
+ av_log(c, AV_LOG_ERROR, "Can't acquire dc1394 handle on port %d\n", 0 /* ap->port */);
goto out;
}
camera_nodes = dc1394_get_camera_nodes(dc1394->handle, &res, 1);
@@ -111,23 +111,23 @@
goto out_handle;
}
res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[ap->channel],
- 0,
- FORMAT_VGA_NONCOMPRESSED,
- fmt->frame_size_id,
- SPEED_400,
- fps->frame_rate_id, 8, 1,
- ap->device,
- &dc1394->camera);
+ 0,
+ FORMAT_VGA_NONCOMPRESSED,
+ fmt->frame_size_id,
+ SPEED_400,
+ fps->frame_rate_id, 8, 1,
+ ap->device,
+ &dc1394->camera);
dc1394_free_camera_nodes(camera_nodes);
if (res != DC1394_SUCCESS) {
av_log(c, AV_LOG_ERROR, "Can't prepare camera for the DMA capture\n");
- goto out_handle;
+ goto out_handle;
}
res = dc1394_start_iso_transmission(dc1394->handle, dc1394->camera.node);
if (res != DC1394_SUCCESS) {
av_log(c, AV_LOG_ERROR, "Can't start isochronous transmission\n");
- goto out_handle_dma;
+ goto out_handle_dma;
}
return 0;
@@ -148,7 +148,7 @@
/* discard stale frame */
if (dc1394->current_frame++) {
- if (dc1394_dma_done_with_buffer(&dc1394->camera) != DC1394_SUCCESS)
+ if (dc1394_dma_done_with_buffer(&dc1394->camera) != DC1394_SUCCESS)
av_log(c, AV_LOG_ERROR, "failed to release %d frame\n", dc1394->current_frame);
}
@@ -157,7 +157,7 @@
if (res == DC1394_SUCCESS) {
dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->fps;
- res = dc1394->packet.size;
+ res = dc1394->packet.size;
} else {
av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
dc1394->packet.data = NULL;
Index: dv.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/dv.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- dv.c 17 Dec 2005 18:14:36 -0000 1.47
+++ dv.c 22 Dec 2005 01:10:11 -0000 1.48
@@ -153,13 +153,13 @@
shift = (sample & 0xf00) >> 8;
if (shift < 0x2 || shift > 0xd) {
- result = sample;
+ result = sample;
} else if (shift < 0x8) {
shift--;
- result = (sample - (256 * shift)) << shift;
+ result = (sample - (256 * shift)) << shift;
} else {
- shift = 0xe - shift;
- result = ((sample + ((256 * shift) + 1)) << shift) - 1;
+ shift = 0xe - shift;
+ result = ((sample + ((256 * shift) + 1)) << shift) - 1;
}
return result;
@@ -168,7 +168,7 @@
static int dv_audio_frame_size(const DVprofile* sys, int frame)
{
return sys->audio_samples_dist[frame % (sizeof(sys->audio_samples_dist)/
- sizeof(sys->audio_samples_dist[0]))];
+ sizeof(sys->audio_samples_dist[0]))];
}
static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* buf)
@@ -182,17 +182,17 @@
case dv_header525: /* I can't imagine why these two weren't defined as real */
case dv_header625: /* packs in SMPTE314M -- they definitely look like ones */
buf[1] = 0xf8 | /* reserved -- always 1 */
- (0 & 0x07); /* APT: Track application ID */
+ (0 & 0x07); /* APT: Track application ID */
buf[2] = (0 << 7) | /* TF1: audio data is 0 - valid; 1 - invalid */
- (0x0f << 3) | /* reserved -- always 1 */
- (0 & 0x07); /* AP1: Audio application ID */
+ (0x0f << 3) | /* reserved -- always 1 */
+ (0 & 0x07); /* AP1: Audio application ID */
buf[3] = (0 << 7) | /* TF2: video data is 0 - valid; 1 - invalid */
- (0x0f << 3) | /* reserved -- always 1 */
- (0 & 0x07); /* AP2: Video application ID */
+ (0x0f << 3) | /* reserved -- always 1 */
+ (0 & 0x07); /* AP2: Video application ID */
buf[4] = (0 << 7) | /* TF3: subcode(SSYB) is 0 - valid; 1 - invalid */
- (0x0f << 3) | /* reserved -- always 1 */
- (0 & 0x07); /* AP3: Subcode application ID */
- break;
+ (0x0f << 3) | /* reserved -- always 1 */
+ (0 & 0x07); /* AP3: Subcode application ID */
+ break;
case dv_timecode:
ct = (time_t)(c->frames / ((float)c->sys->frame_rate /
(float)c->sys->frame_rate_base));
@@ -202,109 +202,109 @@
* minute, unless it is exactly divisible by 10
*/
ltc_frame = (c->frames + 2*ct/60 - 2*ct/600) % c->sys->ltc_divisor;
- buf[1] = (0 << 7) | /* Color fame: 0 - unsync; 1 - sync mode */
- (1 << 6) | /* Drop frame timecode: 0 - nondrop; 1 - drop */
- ((ltc_frame / 10) << 4) | /* Tens of frames */
- (ltc_frame % 10); /* Units of frames */
- buf[2] = (1 << 7) | /* Biphase mark polarity correction: 0 - even; 1 - odd */
- ((tc.tm_sec / 10) << 4) | /* Tens of seconds */
- (tc.tm_sec % 10); /* Units of seconds */
- buf[3] = (1 << 7) | /* Binary group flag BGF0 */
- ((tc.tm_min / 10) << 4) | /* Tens of minutes */
- (tc.tm_min % 10); /* Units of minutes */
- buf[4] = (1 << 7) | /* Binary group flag BGF2 */
- (1 << 6) | /* Binary group flag BGF1 */
- ((tc.tm_hour / 10) << 4) | /* Tens of hours */
- (tc.tm_hour % 10); /* Units of hours */
+ buf[1] = (0 << 7) | /* Color fame: 0 - unsync; 1 - sync mode */
+ (1 << 6) | /* Drop frame timecode: 0 - nondrop; 1 - drop */
+ ((ltc_frame / 10) << 4) | /* Tens of frames */
+ (ltc_frame % 10); /* Units of frames */
+ buf[2] = (1 << 7) | /* Biphase mark polarity correction: 0 - even; 1 - odd */
+ ((tc.tm_sec / 10) << 4) | /* Tens of seconds */
+ (tc.tm_sec % 10); /* Units of seconds */
+ buf[3] = (1 << 7) | /* Binary group flag BGF0 */
+ ((tc.tm_min / 10) << 4) | /* Tens of minutes */
+ (tc.tm_min % 10); /* Units of minutes */
+ buf[4] = (1 << 7) | /* Binary group flag BGF2 */
+ (1 << 6) | /* Binary group flag BGF1 */
+ ((tc.tm_hour / 10) << 4) | /* Tens of hours */
+ (tc.tm_hour % 10); /* Units of hours */
break;
case dv_audio_source: /* AAUX source pack */
buf[1] = (0 << 7) | /* locked mode */
(1 << 6) | /* reserved -- always 1 */
- (dv_audio_frame_size(c->sys, c->frames) -
- c->sys->audio_min_samples[0]);
- /* # of samples */
+ (dv_audio_frame_size(c->sys, c->frames) -
+ c->sys->audio_min_samples[0]);
+ /* # of samples */
buf[2] = (0 << 7) | /* multi-stereo */
(0 << 5) | /* #of audio channels per block: 0 -- 1 channel */
(0 << 4) | /* pair bit: 0 -- one pair of channels */
- 0; /* audio mode */
+ 0; /* audio mode */
buf[3] = (1 << 7) | /* res */
(1 << 6) | /* multi-language flag */
- (c->sys->dsf << 5) | /* system: 60fields/50fields */
- 0; /* definition: 0 -- SD (525/625) */
+ (c->sys->dsf << 5) | /* system: 60fields/50fields */
+ 0; /* definition: 0 -- SD (525/625) */
buf[4] = (1 << 7) | /* emphasis: 1 -- off */
(0 << 6) | /* emphasis time constant: 0 -- reserved */
- (0 << 3) | /* frequency: 0 -- 48Khz, 1 -- 44,1Khz, 2 -- 32Khz */
+ (0 << 3) | /* frequency: 0 -- 48Khz, 1 -- 44,1Khz, 2 -- 32Khz */
0; /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */
break;
case dv_audio_control:
buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */
(1 << 4) | /* input source: 1 -- digital input */
- (3 << 2) | /* compression: 3 -- no information */
- 0; /* misc. info/SMPTE emphasis off */
+ (3 << 2) | /* compression: 3 -- no information */
+ 0; /* misc. info/SMPTE emphasis off */
buf[2] = (1 << 7) | /* recording start point: 1 -- no */
(1 << 6) | /* recording end point: 1 -- no */
- (1 << 3) | /* recording mode: 1 -- original */
- 7;
+ (1 << 3) | /* recording mode: 1 -- original */
+ 7;
buf[3] = (1 << 7) | /* direction: 1 -- forward */
0x20; /* speed */
buf[4] = (1 << 7) | /* reserved -- always 1 */
0x7f; /* genre category */
- break;
+ break;
case dv_audio_recdate:
case dv_video_recdate: /* VAUX recording date */
ct = c->start_time + (time_t)(c->frames /
- ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
+ ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
brktimegm(ct, &tc);
- buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
- /* 0xff is very likely to be "unknown" */
- buf[2] = (3 << 6) | /* reserved -- always 1 */
- ((tc.tm_mday / 10) << 4) | /* Tens of day */
- (tc.tm_mday % 10); /* Units of day */
- buf[3] = /* we set high 4 bits to 0, shouldn't we set them to week? */
- ((tc.tm_mon / 10) << 4) | /* Tens of month */
- (tc.tm_mon % 10); /* Units of month */
- buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */
- (tc.tm_year % 10); /* Units of year */
+ buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
+ /* 0xff is very likely to be "unknown" */
+ buf[2] = (3 << 6) | /* reserved -- always 1 */
+ ((tc.tm_mday / 10) << 4) | /* Tens of day */
+ (tc.tm_mday % 10); /* Units of day */
+ buf[3] = /* we set high 4 bits to 0, shouldn't we set them to week? */
+ ((tc.tm_mon / 10) << 4) | /* Tens of month */
+ (tc.tm_mon % 10); /* Units of month */
+ buf[4] = (((tc.tm_year % 100) / 10) << 4) | /* Tens of year */
+ (tc.tm_year % 10); /* Units of year */
break;
case dv_audio_rectime: /* AAUX recording time */
case dv_video_rectime: /* VAUX recording time */
ct = c->start_time + (time_t)(c->frames /
- ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
- brktimegm(ct, &tc);
- buf[1] = (3 << 6) | /* reserved -- always 1 */
- 0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
- buf[2] = (1 << 7) | /* reserved -- always 1 */
- ((tc.tm_sec / 10) << 4) | /* Tens of seconds */
- (tc.tm_sec % 10); /* Units of seconds */
- buf[3] = (1 << 7) | /* reserved -- always 1 */
- ((tc.tm_min / 10) << 4) | /* Tens of minutes */
- (tc.tm_min % 10); /* Units of minutes */
- buf[4] = (3 << 6) | /* reserved -- always 1 */
- ((tc.tm_hour / 10) << 4) | /* Tens of hours */
- (tc.tm_hour % 10); /* Units of hours */
- break;
+ ((float)c->sys->frame_rate / (float)c->sys->frame_rate_base));
+ brktimegm(ct, &tc);
+ buf[1] = (3 << 6) | /* reserved -- always 1 */
+ 0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
+ buf[2] = (1 << 7) | /* reserved -- always 1 */
+ ((tc.tm_sec / 10) << 4) | /* Tens of seconds */
+ (tc.tm_sec % 10); /* Units of seconds */
+ buf[3] = (1 << 7) | /* reserved -- always 1 */
+ ((tc.tm_min / 10) << 4) | /* Tens of minutes */
+ (tc.tm_min % 10); /* Units of minutes */
+ buf[4] = (3 << 6) | /* reserved -- always 1 */
+ ((tc.tm_hour / 10) << 4) | /* Tens of hours */
+ (tc.tm_hour % 10); /* Units of hours */
+ break;
case dv_video_source:
- buf[1] = 0xff; /* reserved -- always 1 */
- buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */
- (1 << 6) | /* following CLF is valid - 0, invalid - 1 */
- (3 << 4) | /* CLF: color frames id (see ITU-R BT.470-4) */
- 0xf; /* reserved -- always 1 */
- buf[3] = (3 << 6) | /* reserved -- always 1 */
- (c->sys->dsf << 5) | /* system: 60fields/50fields */
- 0; /* signal type video compression */
- buf[4] = 0xff; /* VISC: 0xff -- no information */
+ buf[1] = 0xff; /* reserved -- always 1 */
+ buf[2] = (1 << 7) | /* B/W: 0 - b/w, 1 - color */
+ (1 << 6) | /* following CLF is valid - 0, invalid - 1 */
+ (3 << 4) | /* CLF: color frames id (see ITU-R BT.470-4) */
+ 0xf; /* reserved -- always 1 */
+ buf[3] = (3 << 6) | /* reserved -- always 1 */
+ (c->sys->dsf << 5) | /* system: 60fields/50fields */
+ 0; /* signal type video compression */
+ buf[4] = 0xff; /* VISC: 0xff -- no information */
break;
case dv_video_control:
- buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */
- 0x3f; /* reserved -- always 1 */
- buf[2] = 0xc8 | /* reserved -- always b11001xxx */
- c->aspect;
- buf[3] = (1 << 7) | /* Frame/field flag 1 -- frame, 0 -- field */
- (1 << 6) | /* First/second field flag 0 -- field 2, 1 -- field 1 */
- (1 << 5) | /* Frame change flag 0 -- same picture as before, 1 -- different */
- (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */
- 0xc; /* reserved -- always b1100 */
- buf[4] = 0xff; /* reserved -- always 1 */
+ buf[1] = (0 << 6) | /* Copy generation management (CGMS) 0 -- free */
+ 0x3f; /* reserved -- always 1 */
+ buf[2] = 0xc8 | /* reserved -- always b11001xxx */
+ c->aspect;
+ buf[3] = (1 << 7) | /* Frame/field flag 1 -- frame, 0 -- field */
+ (1 << 6) | /* First/second field flag 0 -- field 2, 1 -- field 1 */
+ (1 << 5) | /* Frame change flag 0 -- same picture as before, 1 -- different */
+ (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */
+ 0xc; /* reserved -- always b1100 */
+ buf[4] = 0xff; /* reserved -- always 1 */
break;
default:
buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
@@ -317,8 +317,8 @@
{
buf[0] = (uint8_t)t; /* Section type */
buf[1] = (seq_num<<4) | /* DIF seq number 0-9 for 525/60; 0-11 for 625/50 */
- (0 << 3) | /* FSC: for 50Mb/s 0 - first channel; 1 - second */
- 7; /* reserved -- always 1 */
+ (0 << 3) | /* FSC: for 50Mb/s 0 - first channel; 1 - second */
+ 7; /* reserved -- always 1 */
buf[2] = dif_num; /* DIF block number Video: 0-134, Audio: 0-8 */
return 3;
}
@@ -326,18 +326,18 @@
static inline int dv_write_ssyb_id(uint8_t syb_num, uint8_t fr, uint8_t* buf)
{
if (syb_num == 0 || syb_num == 6) {
- buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
- (0<<4) | /* AP3 (Subcode application ID) */
- 0x0f; /* reserved -- always 1 */
+ buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
+ (0<<4) | /* AP3 (Subcode application ID) */
+ 0x0f; /* reserved -- always 1 */
}
else if (syb_num == 11) {
- buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
+ buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
0x7f; /* reserved -- always 1 */
}
else {
- buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
+ buf[0] = (fr<<7) | /* FR ID 1 - first half of each channel; 0 - second */
(0<<4) | /* APT (Track application ID) */
- 0x0f; /* reserved -- always 1 */
+ 0x0f; /* reserved -- always 1 */
}
buf[1] = 0xf0 | /* reserved -- always 1 */
(syb_num & 0x0f); /* SSYB number 0 - 11 */
@@ -360,33 +360,33 @@
/* DV subcode: 2DIFs */
for (j = 0; j < 2; j++) {
buf += dv_write_dif_id( dv_sect_subcode, i, j, buf);
- for (k = 0; k < 6; k++) {
- buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size/2), buf);
- buf += dv_write_pack(dv_ssyb_packs_dist[i][k], c, buf);
- }
- buf += 29; /* unused bytes */
+ for (k = 0; k < 6; k++) {
+ buf += dv_write_ssyb_id(k, (i < c->sys->difseg_size/2), buf);
+ buf += dv_write_pack(dv_ssyb_packs_dist[i][k], c, buf);
+ }
+ buf += 29; /* unused bytes */
}
/* DV VAUX: 3DIFs */
for (j = 0; j < 3; j++) {
- buf += dv_write_dif_id(dv_sect_vaux, i, j, buf);
- for (k = 0; k < 15 ; k++)
- buf += dv_write_pack(dv_vaux_packs_dist[i][k], c, buf);
- buf += 2; /* unused bytes */
+ buf += dv_write_dif_id(dv_sect_vaux, i, j, buf);
+ for (k = 0; k < 15 ; k++)
+ buf += dv_write_pack(dv_vaux_packs_dist[i][k], c, buf);
+ buf += 2; /* unused bytes */
}
/* DV Audio/Video: 135 Video DIFs + 9 Audio DIFs */
for (j = 0; j < 135; j++) {
if (j%15 == 0) {
- memset(buf, 0xff, 80);
- buf += dv_write_dif_id(dv_sect_audio, i, j/15, buf);
+ memset(buf, 0xff, 80);
+ buf += dv_write_dif_id(dv_sect_audio, i, j/15, buf);
buf += 77; /* audio control & shuffled PCM audio */
- }
- buf += dv_write_dif_id(dv_sect_video, i, j, buf);
- buf += 77; /* 1 video macro block: 1 bytes control
- 4 * 14 bytes Y 8x8 data
- 10 bytes Cr 8x8 data
- 10 bytes Cb 8x8 data */
+ }
+ buf += dv_write_dif_id(dv_sect_video, i, j, buf);
+ buf += 77; /* 1 video macro block: 1 bytes control
+ 4 * 14 bytes Y 8x8 data
+ 10 bytes Cr 8x8 data
+ 10 bytes Cb 8x8 data */
}
}
}
@@ -398,14 +398,14 @@
for (i = 0; i < c->sys->difseg_size; i++) {
frame_ptr += 6 * 80; /* skip DIF segment header */
for (j = 0; j < 9; j++) {
- dv_write_pack(dv_aaux_packs_dist[i][j], c, &frame_ptr[3]);
+ dv_write_pack(dv_aaux_packs_dist[i][j], c, &frame_ptr[3]);
for (d = 8; d < 80; d+=2) {
- of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride;
- if (of*2 >= size)
- continue;
+ of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride;
+ if (of*2 >= size)
+ continue;
- frame_ptr[d] = pcm[of*2+1]; // FIXME: may be we have to admit
- frame_ptr[d+1] = pcm[of*2]; // that DV is a big endian PCM
+ frame_ptr[d] = pcm[of*2+1]; // FIXME: may be we have to admit
+ frame_ptr[d+1] = pcm[of*2]; // that DV is a big endian PCM
}
frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
}
@@ -421,10 +421,10 @@
ptr += 6 * 80; /* skip DIF segment header */
for (j = 0; j < 135; j++) {
if (j%15 == 0)
- ptr += 80; /* skip Audio DIF */
- ptr += 3;
- memcpy(frame_ptr + ptr, video_data + ptr, 77);
- ptr += 77;
+ ptr += 80; /* skip Audio DIF */
+ ptr += 3;
+ memcpy(frame_ptr + ptr, video_data + ptr, 77);
+ ptr += 77;
}
}
}
@@ -441,10 +441,10 @@
switch (t) {
case dv_audio_source:
offs = (80*6 + 80*16*3 + 3);
- break;
+ break;
case dv_audio_control:
offs = (80*6 + 80*16*4 + 3);
- break;
+ break;
case dv_video_control:
offs = (80*5 + 48 + 5);
break;
@@ -472,7 +472,7 @@
as_pack = dv_extract_pack(frame, dv_audio_source);
if (!as_pack) /* No audio ? */
- return 0;
+ return 0;
sys = dv_frame_profile(frame);
smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
@@ -480,7 +480,7 @@
quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
if (quant > 1)
- return -1; /* Unsupported quantization */
+ return -1; /* Unsupported quantization */
size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
half_ch = sys->difseg_size/2;
@@ -497,38 +497,38 @@
for (j = 0; j < 9; j++) {
for (d = 8; d < 80; d += 2) {
- if (quant == 0) { /* 16bit quantization */
- of = sys->audio_shuffle[i][j] + (d - 8)/2 * sys->audio_stride;
+ if (quant == 0) { /* 16bit quantization */
+ of = sys->audio_shuffle[i][j] + (d - 8)/2 * sys->audio_stride;
if (of*2 >= size)
- continue;
+ continue;
- pcm[of*2] = frame[d+1]; // FIXME: may be we have to admit
- pcm[of*2+1] = frame[d]; // that DV is a big endian PCM
- if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
- pcm[of*2+1] = 0;
- } else { /* 12bit quantization */
- lc = ((uint16_t)frame[d] << 4) |
- ((uint16_t)frame[d+2] >> 4);
- rc = ((uint16_t)frame[d+1] << 4) |
- ((uint16_t)frame[d+2] & 0x0f);
- lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
- rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
+ pcm[of*2] = frame[d+1]; // FIXME: may be we have to admit
+ pcm[of*2+1] = frame[d]; // that DV is a big endian PCM
+ if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
+ pcm[of*2+1] = 0;
+ } else { /* 12bit quantization */
+ lc = ((uint16_t)frame[d] << 4) |
+ ((uint16_t)frame[d+2] >> 4);
+ rc = ((uint16_t)frame[d+1] << 4) |
+ ((uint16_t)frame[d+2] & 0x0f);
+ lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
+ rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
- of = sys->audio_shuffle[i%half_ch][j] + (d - 8)/3 * sys->audio_stride;
+ of = sys->audio_shuffle[i%half_ch][j] + (d - 8)/3 * sys->audio_stride;
if (of*2 >= size)
- continue;
+ continue;
- pcm[of*2] = lc & 0xff; // FIXME: may be we have to admit
- pcm[of*2+1] = lc >> 8; // that DV is a big endian PCM
- of = sys->audio_shuffle[i%half_ch+half_ch][j] +
- (d - 8)/3 * sys->audio_stride;
- pcm[of*2] = rc & 0xff; // FIXME: may be we have to admit
- pcm[of*2+1] = rc >> 8; // that DV is a big endian PCM
- ++d;
- }
- }
+ pcm[of*2] = lc & 0xff; // FIXME: may be we have to admit
+ pcm[of*2+1] = lc >> 8; // that DV is a big endian PCM
+ of = sys->audio_shuffle[i%half_ch+half_ch][j] +
+ (d - 8)/3 * sys->audio_stride;
+ pcm[of*2] = rc & 0xff; // FIXME: may be we have to admit
+ pcm[of*2+1] = rc >> 8; // that DV is a big endian PCM
+ ++d;
+ }
+ }
- frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
+ frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
}
}
@@ -545,7 +545,7 @@
as_pack = dv_extract_pack(frame, dv_audio_source);
if (!as_pack || !sys) { /* No audio ? */
c->ach = 0;
- return 0;
+ return 0;
}
smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
@@ -557,11 +557,11 @@
for (i=0; i<ach; i++) {
if (!c->ast[i]) {
c->ast[i] = av_new_stream(c->fctx, 0);
- if (!c->ast[i])
- break;
- av_set_pts_info(c->ast[i], 64, 1, 30000);
- c->ast[i]->codec->codec_type = CODEC_TYPE_AUDIO;
- c->ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
+ if (!c->ast[i])
+ break;
+ av_set_pts_info(c->ast[i], 64, 1, 30000);
+ c->ast[i]->codec->codec_type = CODEC_TYPE_AUDIO;
+ c->ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
av_init_packet(&c->audio_pkt[i]);
c->audio_pkt[i].size = 0;
@@ -599,14 +599,14 @@
}
avctx->pix_fmt = sys->pix_fmt;
- /* finding out SAR is a little bit messy */
- vsc_pack = dv_extract_pack(frame, dv_video_control);
+ /* finding out SAR is a little bit messy */
+ vsc_pack = dv_extract_pack(frame, dv_video_control);
apt = frame[4] & 0x07;
- is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
- (!apt && (vsc_pack[2] & 0x07) == 0x07)));
- avctx->sample_aspect_ratio = sys->sar[is16_9];
+ is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
+ (!apt && (vsc_pack[2] & 0x07) == 0x07)));
+ avctx->sample_aspect_ratio = sys->sar[is16_9];
- size = sys->frame_size;
+ size = sys->frame_size;
}
return size;
}
@@ -624,44 +624,44 @@
*frame = &c->frame_buf[0];
if (c->has_audio && c->has_video) { /* must be a stale frame */
dv_format_frame(c, *frame);
- c->frames++;
- if (c->has_audio > 0)
- c->has_audio = 0;
- c->has_video = 0;
+ c->frames++;
+ if (c->has_audio > 0)
+ c->has_audio = 0;
+ c->has_video = 0;
}
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
/* FIXME: we have to have more sensible approach than this one */
- if (c->has_video)
- av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);
+ if (c->has_video)
+ av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);
dv_inject_video(c, data, *frame);
- c->has_video = 1;
- data_size = 0;
- if (c->has_audio < 0)
- goto out;
+ c->has_video = 1;
+ data_size = 0;
+ if (c->has_audio < 0)
+ goto out;
}
reqasize = 4 * dv_audio_frame_size(c->sys, c->frames);
fsize = fifo_size(&c->audio_data, c->audio_data.rptr);
if (st->codec->codec_type == CODEC_TYPE_AUDIO || (c->has_video && fsize >= reqasize)) {
- if (fsize + data_size >= reqasize && !c->has_audio) {
+ if (fsize + data_size >= reqasize && !c->has_audio) {
if (fsize >= reqasize) {
- fifo_read(&c->audio_data, &pcm[0], reqasize, &c->audio_data.rptr);
+ fifo_read(&c->audio_data, &pcm[0], reqasize, &c->audio_data.rptr);
} else {
- fifo_read(&c->audio_data, &pcm[0], fsize, &c->audio_data.rptr);
+ fifo_read(&c->audio_data, &pcm[0], fsize, &c->audio_data.rptr);
memcpy(&pcm[fsize], &data[0], reqasize - fsize);
- data += reqasize - fsize;
- data_size -= reqasize - fsize;
- }
- dv_inject_audio(c, &pcm[0], *frame);
- c->has_audio = 1;
- }
+ data += reqasize - fsize;
+ data_size -= reqasize - fsize;
+ }
+ dv_inject_audio(c, &pcm[0], *frame);
+ c->has_audio = 1;
+ }
/* FIXME: we have to have more sensible approach than this one */
if (fifo_size(&c->audio_data, c->audio_data.rptr) + data_size >= 100*AVCODEC_MAX_AUDIO_FRAME_SIZE)
- av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames);
- fifo_write(&c->audio_data, (uint8_t *)data, data_size, &c->audio_data.wptr);
+ av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->frames);
+ fifo_write(&c->audio_data, (uint8_t *)data, data_size, &c->audio_data.wptr);
}
out:
@@ -685,27 +685,27 @@
/* We have to sort out where audio and where video stream is */
for (i=0; i<s->nb_streams; i++) {
switch (s->streams[i]->codec->codec_type) {
- case CODEC_TYPE_VIDEO:
- vst = s->streams[i];
- break;
- case CODEC_TYPE_AUDIO:
- ast = s->streams[i];
- break;
- default:
- goto bail_out;
- }
+ case CODEC_TYPE_VIDEO:
+ vst = s->streams[i];
+ break;
+ case CODEC_TYPE_AUDIO:
+ ast = s->streams[i];
+ break;
+ default:
+ goto bail_out;
+ }
}
/* Some checks -- DV format is very picky about its incoming streams */
if (!vst || vst->codec->codec_id != CODEC_ID_DVVIDEO)
goto bail_out;
if (ast && (ast->codec->codec_id != CODEC_ID_PCM_S16LE ||
- ast->codec->sample_rate != 48000 ||
- ast->codec->channels != 2))
- goto bail_out;
+ ast->codec->sample_rate != 48000 ||
+ ast->codec->channels != 2))
+ goto bail_out;
c->sys = dv_codec_profile(vst->codec);
if (!c->sys)
- goto bail_out;
+ goto bail_out;
/* Ok, everything seems to be in working order */
c->frames = 0;
@@ -769,9 +769,9 @@
for (i=0; i<c->ach; i++) {
if (c->ast[i] && c->audio_pkt[i].size) {
*pkt = c->audio_pkt[i];
- c->audio_pkt[i].size = 0;
- size = pkt->size;
- break;
+ c->audio_pkt[i].size = 0;
+ size = pkt->size;
+ break;
}
}
@@ -874,9 +874,9 @@
size = dv_frame_profile(c->buf)->frame_size;
if (get_buffer(&s->pb, c->buf + 4, size - 4) <= 0)
- return AVERROR_IO;
+ return AVERROR_IO;
- size = dv_produce_packet(c->dv_demux, pkt, c->buf, size);
+ size = dv_produce_packet(c->dv_demux, pkt, c->buf, size);
}
return size;
@@ -912,9 +912,9 @@
s->priv_data = dv_init_mux(s);
if (!s->priv_data) {
av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"
- "Make sure that you supply exactly two streams:\n"
- " video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n");
- return -1;
+ "Make sure that you supply exactly two streams:\n"
+ " video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n");
+ return -1;
}
return 0;
}
Index: dv1394.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/dv1394.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dv1394.c 17 Dec 2005 18:14:36 -0000 1.17
+++ dv1394.c 22 Dec 2005 01:10:11 -0000 1.18
@@ -88,9 +88,9 @@
goto failed;
if (ap->standard && !strcasecmp(ap->standard, "pal"))
- dv->format = DV1394_PAL;
+ dv->format = DV1394_PAL;
else
- dv->format = DV1394_NTSC;
+ dv->format = DV1394_NTSC;
if (ap->channel)
dv->channel = ap->channel;
@@ -202,7 +202,7 @@
size = dv_produce_packet(dv->dv_demux, pkt,
dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE),
- DV1394_PAL_FRAME_SIZE);
+ DV1394_PAL_FRAME_SIZE);
dv->index = (dv->index + 1) % DV1394_RING_FRAMES;
dv->done++; dv->avail--;
Index: dv1394.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/dv1394.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dv1394.h 17 Dec 2005 18:14:36 -0000 1.5
+++ dv1394.h 22 Dec 2005 01:10:11 -0000 1.6
@@ -60,21 +60,21 @@
Example 1:
To play a raw .DV file: cat foo.DV > /dev/dv1394
- (cat will use write() internally)
+ (cat will use write() internally)
Example 2:
static struct dv1394_init init = {
- 0x63, (broadcast channel)
+ 0x63, (broadcast channel)
4, (four-frame ringbuffer)
- DV1394_NTSC, (send NTSC video)
- 0, 0 (default empty packet rate)
+ DV1394_NTSC, (send NTSC video)
+ 0, 0 (default empty packet rate)
}
- ioctl(fd, DV1394_INIT, &init);
+ ioctl(fd, DV1394_INIT, &init);
- while(1) {
- read( <a raw DV file>, buf, DV1394_NTSC_FRAME_SIZE );
- write( <the dv1394 FD>, buf, DV1394_NTSC_FRAME_SIZE );
+ while(1) {
+ read( <a raw DV file>, buf, DV1394_NTSC_FRAME_SIZE );
+ write( <the dv1394 FD>, buf, DV1394_NTSC_FRAME_SIZE );
}
2)
@@ -104,12 +104,12 @@
frame 0 frame 1 frame 2 frame 3
- *--------------------------------------*
+ *--------------------------------------*
| CLEAR | DV data | DV data | CLEAR |
*--------------------------------------*
<ACTIVE>
- transmission goes in this direction --->>>
+ transmission goes in this direction --->>>
The DV hardware is currently transmitting the data in frame 1.
@@ -123,9 +123,9 @@
receive the following values:
n_frames = 4
- active_frame = 1
- first_clear_frame = 3
- n_clear_frames = 2
+ active_frame = 1
+ first_clear_frame = 3
+ n_clear_frames = 2
At this point, you should write new DV data into frame 3 and optionally
frame 0. Then call DV1394_SUBMIT_FRAMES to inform the device that
@@ -170,11 +170,11 @@
ioctl(dv1394_fd, DV1394_GET_STATUS, &status);
- if(status.dropped_frames > 0) {
- reset_dv1394();
+ if(status.dropped_frames > 0) {
+ reset_dv1394();
} else {
for(int i = 0; i < status.n_clear_frames; i++) {
- copy_DV_frame();
+ copy_DV_frame();
}
}
}
@@ -210,51 +210,51 @@
/* ioctl() commands */
enum {
- /* I don't like using 0 as a valid ioctl() */
- DV1394_INVALID = 0,
+ /* I don't like using 0 as a valid ioctl() */
+ DV1394_INVALID = 0,
- /* get the driver ready to transmit video.
- pass a struct dv1394_init* as the parameter (see below),
- or NULL to get default parameters */
- DV1394_INIT,
+ /* get the driver ready to transmit video.
+ pass a struct dv1394_init* as the parameter (see below),
+ or NULL to get default parameters */
+ DV1394_INIT,
- /* stop transmitting video and free the ringbuffer */
- DV1394_SHUTDOWN,
+ /* stop transmitting video and free the ringbuffer */
+ DV1394_SHUTDOWN,
- /* submit N new frames to be transmitted, where
- the index of the first new frame is first_clear_buffer,
- and the index of the last new frame is
- (first_clear_buffer + N) % n_frames */
- DV1394_SUBMIT_FRAMES,
+ /* submit N new frames to be transmitted, where
+ the index of the first new frame is first_clear_buffer,
+ and the index of the last new frame is
+ (first_clear_buffer + N) % n_frames */
+ DV1394_SUBMIT_FRAMES,
- /* block until N buffers are clear (pass N as the parameter)
- Because we re-transmit the last frame on underrun, there
- will at most be n_frames - 1 clear frames at any time */
- DV1394_WAIT_FRAMES,
+ /* block until N buffers are clear (pass N as the parameter)
+ Because we re-transmit the last frame on underrun, there
+ will at most be n_frames - 1 clear frames at any time */
+ DV1394_WAIT_FRAMES,
- /* capture new frames that have been received, where
- the index of the first new frame is first_clear_buffer,
- and the index of the last new frame is
- (first_clear_buffer + N) % n_frames */
- DV1394_RECEIVE_FRAMES,
+ /* capture new frames that have been received, where
+ the index of the first new frame is first_clear_buffer,
+ and the index of the last new frame is
+ (first_clear_buffer + N) % n_frames */
+ DV1394_RECEIVE_FRAMES,
- DV1394_START_RECEIVE,
+ DV1394_START_RECEIVE,
- /* pass a struct dv1394_status* as the parameter (see below) */
- DV1394_GET_STATUS,
+ /* pass a struct dv1394_status* as the parameter (see below) */
+ DV1394_GET_STATUS,
};
enum pal_or_ntsc {
- DV1394_NTSC = 0,
- DV1394_PAL
+ DV1394_NTSC = 0,
+ DV1394_PAL
};
@@ -262,29 +262,29 @@
/* this is the argument to DV1394_INIT */
struct dv1394_init {
- /* DV1394_API_VERSION */
- unsigned int api_version;
+ /* DV1394_API_VERSION */
+ unsigned int api_version;
- /* isochronous transmission channel to use */
- unsigned int channel;
+ /* isochronous transmission channel to use */
+ unsigned int channel;
- /* number of frames in the ringbuffer. Must be at least 2
- and at most DV1394_MAX_FRAMES. */
- unsigned int n_frames;
+ /* number of frames in the ringbuffer. Must be at least 2
+ and at most DV1394_MAX_FRAMES. */
+ unsigned int n_frames;
- /* send/receive PAL or NTSC video format */
- enum pal_or_ntsc format;
+ /* send/receive PAL or NTSC video format */
+ enum pal_or_ntsc format;
- /* the following are used only for transmission */
+ /* the following are used only for transmission */
- /* set these to zero unless you want a
- non-default empty packet rate (see below) */
- unsigned long cip_n;
- unsigned long cip_d;
+ /* set these to zero unless you want a
+ non-default empty packet rate (see below) */
+ unsigned long cip_n;
+ unsigned long cip_d;
- /* set this to zero unless you want a
- non-default SYT cycle offset (default = 3 cycles) */
- unsigned int syt_offset;
+ /* set this to zero unless you want a
+ non-default SYT cycle offset (default = 3 cycles) */
+ unsigned int syt_offset;
};
/* NOTE: you may only allocate the DV frame ringbuffer once each time
@@ -322,32 +322,32 @@
struct dv1394_status {
- /* this embedded init struct returns the current dv1394
- parameters in use */
- struct dv1394_init init;
+ /* this embedded init struct returns the current dv1394
+ parameters in use */
+ struct dv1394_init init;
- /* the ringbuffer frame that is currently being
- displayed. (-1 if the device is not transmitting anything) */
- int active_frame;
+ /* the ringbuffer frame that is currently being
+ displayed. (-1 if the device is not transmitting anything) */
+ int active_frame;
- /* index of the first buffer (ahead of active_frame) that
- is ready to be filled with data */
- unsigned int first_clear_frame;
+ /* index of the first buffer (ahead of active_frame) that
+ is ready to be filled with data */
+ unsigned int first_clear_frame;
- /* how many buffers, including first_clear_buffer, are
- ready to be filled with data */
- unsigned int n_clear_frames;
+ /* how many buffers, including first_clear_buffer, are
+ ready to be filled with data */
+ unsigned int n_clear_frames;
- /* how many times the DV stream has underflowed, overflowed,
- or otherwise encountered an error, since the previous call
- to DV1394_GET_STATUS */
- unsigned int dropped_frames;
+ /* how many times the DV stream has underflowed, overflowed,
+ or otherwise encountered an error, since the previous call
+ to DV1394_GET_STATUS */
+ unsigned int dropped_frames;
- /* N.B. The dropped_frames counter is only a lower bound on the actual
- number of dropped frames, with the special case that if dropped_frames
- is zero, then it is guaranteed that NO frames have been dropped
- since the last call to DV1394_GET_STATUS.
- */
+ /* N.B. The dropped_frames counter is only a lower bound on the actual
+ number of dropped frames, with the special case that if dropped_frames
+ is zero, then it is guaranteed that NO frames have been dropped
+ since the last call to DV1394_GET_STATUS.
+ */
};
Index: ffm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/ffm.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- ffm.c 17 Dec 2005 18:14:36 -0000 1.47
+++ ffm.c 22 Dec 2005 01:10:11 -0000 1.48
@@ -159,7 +159,7 @@
put_be32(pb, codec->codec_id);
put_byte(pb, codec->codec_type);
put_be32(pb, codec->bit_rate);
- put_be32(pb, st->quality);
+ put_be32(pb, st->quality);
put_be32(pb, codec->flags);
put_be32(pb, codec->flags2);
put_be32(pb, codec->debug);
Index: flvdec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/flvdec.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- flvdec.c 17 Dec 2005 18:14:36 -0000 1.23
+++ flvdec.c 22 Dec 2005 01:10:11 -0000 1.24
@@ -155,25 +155,25 @@
else
st->codec->sample_rate = (44100<<((flags>>2)&3))>>3;
switch(flags >> 4){/* 0: uncompressed 1: ADPCM 2: mp3 5: Nellymoser 8kHz mono 6: Nellymoser*/
- case 0: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16BE;
- else st->codec->codec_id = CODEC_ID_PCM_S8; break;
- case 1: st->codec->codec_id = CODEC_ID_ADPCM_SWF; break;
+ case 0: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16BE;
+ else st->codec->codec_id = CODEC_ID_PCM_S8; break;
+ case 1: st->codec->codec_id = CODEC_ID_ADPCM_SWF; break;
case 2: st->codec->codec_id = CODEC_ID_MP3; break;
- // this is not listed at FLV but at SWF, strange...
- case 3: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16LE;
- else st->codec->codec_id = CODEC_ID_PCM_S8; break;
+ // this is not listed at FLV but at SWF, strange...
+ case 3: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16LE;
+ else st->codec->codec_id = CODEC_ID_PCM_S8; break;
default:
- av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4);
+ av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4);
st->codec->codec_tag= (flags >> 4);
}
- st->codec->bits_per_sample = (flags & 2) ? 16 : 8;
+ st->codec->bits_per_sample = (flags & 2) ? 16 : 8;
}
}else{
st->codec->codec_type = CODEC_TYPE_VIDEO;
switch(flags & 0xF){
case 2: st->codec->codec_id = CODEC_ID_FLV1; break;
default:
- av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flags & 0xf);
+ av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flags & 0xf);
st->codec->codec_tag= flags & 0xF;
}
}
@@ -189,7 +189,7 @@
pkt->stream_index = st->index;
if (is_audio || ((flags >> 4)==1))
- pkt->flags |= PKT_FLAG_KEY;
+ pkt->flags |= PKT_FLAG_KEY;
return ret;
}
Index: flvenc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/flvenc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- flvenc.c 17 Dec 2005 18:14:36 -0000 1.20
+++ flvenc.c 22 Dec 2005 01:10:11 -0000 1.21
@@ -58,16 +58,16 @@
flags |= 0x20 | 0x2;
break;
case CODEC_ID_PCM_S8:
- break;
+ break;
case CODEC_ID_PCM_S16BE:
- flags |= 0x60 | 0x2;
- break;
+ flags |= 0x60 | 0x2;
+ break;
case CODEC_ID_PCM_S16LE:
- flags |= 0x2;
- break;
+ flags |= 0x2;
+ break;
case CODEC_ID_ADPCM_SWF:
- flags |= 0x10;
- break;
+ flags |= 0x10;
+ break;
case 0:
flags |= enc->codec_tag<<4;
break;
Index: gif.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/gif.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- gif.c 17 Dec 2005 18:14:36 -0000 1.21
+++ gif.c 22 Dec 2005 01:10:11 -0000 1.22
@@ -199,24 +199,24 @@
}
}
- /* update: this is the 'NETSCAPE EXTENSION' that allows for looped animated gif
- see http://members.aol.com/royalef/gifabout.htm#net-extension
+ /* update: this is the 'NETSCAPE EXTENSION' that allows for looped animated gif
+ see http://members.aol.com/royalef/gifabout.htm#net-extension
- byte 1 : 33 (hex 0x21) GIF Extension code
- byte 2 : 255 (hex 0xFF) Application Extension Label
- byte 3 : 11 (hex (0x0B) Length of Application Block
- (eleven bytes of data to follow)
- bytes 4 to 11 : "NETSCAPE"
- bytes 12 to 14 : "2.0"
- byte 15 : 3 (hex 0x03) Length of Data Sub-Block
- (three bytes of data to follow)
- byte 16 : 1 (hex 0x01)
- bytes 17 to 18 : 0 to 65535, an unsigned integer in
- lo-hi byte format. This indicate the
- number of iterations the loop should
- be executed.
- bytes 19 : 0 (hex 0x00) a Data Sub-block Terminator
- */
+ byte 1 : 33 (hex 0x21) GIF Extension code
+ byte 2 : 255 (hex 0xFF) Application Extension Label
+ byte 3 : 11 (hex (0x0B) Length of Application Block
+ (eleven bytes of data to follow)
+ bytes 4 to 11 : "NETSCAPE"
+ bytes 12 to 14 : "2.0"
+ byte 15 : 3 (hex 0x03) Length of Data Sub-Block
+ (three bytes of data to follow)
+ byte 16 : 1 (hex 0x01)
+ bytes 17 to 18 : 0 to 65535, an unsigned integer in
+ lo-hi byte format. This indicate the
+ number of iterations the loop should
+ be executed.
+ bytes 19 : 0 (hex 0x00) a Data Sub-block Terminator
+ */
/* application extension header */
#ifdef GIF_ADD_APP_HEADER
Index: gifdec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/gifdec.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- gifdec.c 17 Dec 2005 18:14:36 -0000 1.10
+++ gifdec.c 22 Dec 2005 01:10:11 -0000 1.11
@@ -22,8 +22,8 @@
//#define DEBUG
-#define MAXBITS 12
-#define SIZTABLE (1<<MAXBITS)
+#define MAXBITS 12
+#define SIZTABLE (1<<MAXBITS)
#define GCE_DISPOSAL_NONE 0
#define GCE_DISPOSAL_INPLACE 1
@@ -54,14 +54,14 @@
int bbits;
unsigned int bbuf;
- int cursize; /* The current code size */
+ int cursize; /* The current code size */
int curmask;
int codesize;
int clear_code;
int end_code;
- int newcodes; /* First available code */
- int top_slot; /* Highest code for current size */
- int slot; /* Last read code */
+ int newcodes; /* First available code */
+ int top_slot; /* Highest code for current size */
+ int slot; /* Last read code */
int fc, oc;
uint8_t *sp;
uint8_t stack[SIZTABLE];
@@ -97,7 +97,7 @@
int gce_flags, gce_disposal;
if (pd->buf_size < 24 ||
- memcmp(pd->buf, gif89a_sig, 6) != 0)
+ memcmp(pd->buf, gif89a_sig, 6) != 0)
return 0;
p_end = pd->buf + pd->buf_size;
p = pd->buf + 6;
@@ -145,11 +145,11 @@
static int gif_image_probe(AVProbeData * pd)
{
if (pd->buf_size >= 24 &&
- (memcmp(pd->buf, gif87a_sig, 6) == 0 ||
- memcmp(pd->buf, gif89a_sig, 6) == 0))
- return AVPROBE_SCORE_MAX - 1;
+ (memcmp(pd->buf, gif87a_sig, 6) == 0 ||
+ memcmp(pd->buf, gif89a_sig, 6) == 0))
+ return AVPROBE_SCORE_MAX - 1;
else
- return 0;
+ return 0;
}
@@ -198,7 +198,7 @@
s->bbuf |= ptr[0] << s->bbits;
ptr++;
s->pbuf = ptr;
- s->bbits += 8;
+ s->bbits += 8;
}
c = s->bbuf & s->curmask;
s->bbuf >>= s->cursize;
@@ -223,61 +223,61 @@
fc = s->fc;
while (sp > s->stack) {
- *buf++ = *(--sp);
- if ((--l) == 0)
- goto the_end;
+ *buf++ = *(--sp);
+ if ((--l) == 0)
+ goto the_end;
}
for (;;) {
- c = GetCode(s);
- if (c == s->end_code) {
- s->end_code = -1;
- break;
- } else if (c == s->clear_code) {
- s->cursize = s->codesize + 1;
- s->curmask = mask[s->cursize];
- s->slot = s->newcodes;
- s->top_slot = 1 << s->cursize;
- while ((c = GetCode(s)) == s->clear_code);
- if (c == s->end_code) {
- s->end_code = -1;
- break;
- }
- /* test error */
- if (c >= s->slot)
- c = 0;
- fc = oc = c;
- *buf++ = c;
- if ((--l) == 0)
- break;
- } else {
- code = c;
- if (code >= s->slot) {
- *sp++ = fc;
- code = oc;
- }
- while (code >= s->newcodes) {
- *sp++ = s->suffix[code];
- code = s->prefix[code];
- }
- *sp++ = code;
- if (s->slot < s->top_slot) {
- s->suffix[s->slot] = fc = code;
- s->prefix[s->slot++] = oc;
- oc = c;
- }
- if (s->slot >= s->top_slot) {
- if (s->cursize < MAXBITS) {
- s->top_slot <<= 1;
- s->curmask = mask[++s->cursize];
- }
- }
- while (sp > s->stack) {
- *buf++ = *(--sp);
- if ((--l) == 0)
+ c = GetCode(s);
+ if (c == s->end_code) {
+ s->end_code = -1;
+ break;
+ } else if (c == s->clear_code) {
+ s->cursize = s->codesize + 1;
+ s->curmask = mask[s->cursize];
+ s->slot = s->newcodes;
+ s->top_slot = 1 << s->cursize;
+ while ((c = GetCode(s)) == s->clear_code);
+ if (c == s->end_code) {
+ s->end_code = -1;
+ break;
+ }
+ /* test error */
+ if (c >= s->slot)
+ c = 0;
+ fc = oc = c;
+ *buf++ = c;
+ if ((--l) == 0)
+ break;
+ } else {
+ code = c;
+ if (code >= s->slot) {
+ *sp++ = fc;
+ code = oc;
+ }
+ while (code >= s->newcodes) {
+ *sp++ = s->suffix[code];
+ code = s->prefix[code];
+ }
+ *sp++ = code;
+ if (s->slot < s->top_slot) {
+ s->suffix[s->slot] = fc = code;
+ s->prefix[s->slot++] = oc;
+ oc = c;
+ }
+ if (s->slot >= s->top_slot) {
+ if (s->cursize < MAXBITS) {
+ s->top_slot <<= 1;
+ s->curmask = mask[++s->cursize];
+ }
+ }
+ while (sp > s->stack) {
+ *buf++ = *(--sp);
+ if ((--l) == 0)
goto the_end;
- }
- }
+ }
+ }
}
the_end:
s->sp = sp;
@@ -306,7 +306,7 @@
#endif
if (has_local_palette) {
- get_buffer(f, s->local_palette, 3 * (1 << bits_per_pixel));
+ get_buffer(f, s->local_palette, 3 * (1 << bits_per_pixel));
palette = s->local_palette;
} else {
palette = s->global_palette;
@@ -465,10 +465,10 @@
/* read gif signature */
ret = get_buffer(f, sig, 6);
if (ret != 6)
- return -1;
+ return -1;
if (memcmp(sig, gif87a_sig, 6) != 0 &&
- memcmp(sig, gif89a_sig, 6) != 0)
- return -1;
+ memcmp(sig, gif89a_sig, 6) != 0)
+ return -1;
/* read screen header */
s->transparent_color_index = -1;
@@ -485,15 +485,15 @@
has_global_palette = (v & 0x80);
s->bits_per_pixel = (v & 0x07) + 1;
s->background_color_index = get_byte(f);
- get_byte(f); /* ignored */
+ get_byte(f); /* ignored */
#ifdef DEBUG
printf("gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
- s->screen_width, s->screen_height, s->bits_per_pixel,
- has_global_palette);
+ s->screen_width, s->screen_height, s->bits_per_pixel,
+ has_global_palette);
#endif
if (has_global_palette) {
- n = 1 << s->bits_per_pixel;
- get_buffer(f, s->global_palette, n * 3);
+ n = 1 << s->bits_per_pixel;
+ get_buffer(f, s->global_palette, n * 3);
}
return 0;
}
@@ -504,37 +504,37 @@
int ret, code;
for (;;) {
- code = url_fgetc(f);
+ code = url_fgetc(f);
#ifdef DEBUG
- printf("gif: code=%02x '%c'\n", code, code);
+ printf("gif: code=%02x '%c'\n", code, code);
#endif
- switch (code) {
- case ',':
- if (gif_read_image(s) < 0)
- return AVERROR_IO;
- ret = 0;
- goto the_end;
- case ';':
- /* end of image */
- ret = AVERROR_IO;
- goto the_end;
- case '!':
+ switch (code) {
+ case ',':
+ if (gif_read_image(s) < 0)
+ return AVERROR_IO;
+ ret = 0;
+ goto the_end;
+ case ';':
+ /* end of image */
+ ret = AVERROR_IO;
+ goto the_end;
+ case '!':
if (gif_read_extension(s) < 0)
return AVERROR_IO;
- break;
- case EOF:
- default:
- /* error or errneous EOF */
- ret = AVERROR_IO;
- goto the_end;
- }
+ break;
+ case EOF:
+ default:
+ /* error or errneous EOF */
+ ret = AVERROR_IO;
+ goto the_end;
+ }
}
the_end:
return ret;
}
static int gif_read_header(AVFormatContext * s1,
- AVFormatParameters * ap)
+ AVFormatParameters * ap)
{
GifState *s = s1->priv_data;
ByteIOContext *f = &s1->pb;
@@ -553,7 +553,7 @@
/* now we are ready: build format streams */
st = av_new_stream(s1, 0);
if (!st)
- return -1;
+ return -1;
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_RAWVIDEO;
@@ -567,7 +567,7 @@
}
static int gif_read_packet(AVFormatContext * s1,
- AVPacket * pkt)
+ AVPacket * pkt)
{
GifState *s = s1->priv_data;
int ret;
@@ -578,7 +578,7 @@
/* XXX: avoid copying */
if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) {
- return AVERROR_IO;
+ return AVERROR_IO;
}
pkt->stream_index = 0;
memcpy(pkt->data, s->image_buf, s->screen_width * s->screen_height * 3);
Index: grab.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/grab.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- grab.c 17 Dec 2005 18:14:36 -0000 1.38
+++ grab.c 22 Dec 2005 01:10:11 -0000 1.39
@@ -104,7 +104,7 @@
}
if (!(s->video_cap.type & VID_TYPE_CAPTURE)) {
- av_log(s1, AV_LOG_ERROR, "Fatal: grab device does not handle capture\n");
+ av_log(s1, AV_LOG_ERROR, "Fatal: grab device does not handle capture\n");
goto fail;
}
@@ -119,13 +119,13 @@
/* set tv standard */
if (ap->standard && !ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
- if (!strcasecmp(ap->standard, "pal"))
- tuner.mode = VIDEO_MODE_PAL;
- else if (!strcasecmp(ap->standard, "secam"))
- tuner.mode = VIDEO_MODE_SECAM;
- else
- tuner.mode = VIDEO_MODE_NTSC;
- ioctl(video_fd, VIDIOCSTUNER, &tuner);
+ if (!strcasecmp(ap->standard, "pal"))
+ tuner.mode = VIDEO_MODE_PAL;
+ else if (!strcasecmp(ap->standard, "secam"))
+ tuner.mode = VIDEO_MODE_SECAM;
+ else
+ tuner.mode = VIDEO_MODE_NTSC;
+ ioctl(video_fd, VIDIOCSTUNER, &tuner);
}
/* unmute audio */
@@ -234,10 +234,10 @@
}
goto fail;
}
- for (j = 1; j < s->gb_buffers.frames; j++) {
- s->gb_buf.frame = j;
- ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf);
- }
+ for (j = 1; j < s->gb_buffers.frames; j++) {
+ s->gb_buf.frame = j;
+ ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf);
+ }
s->frame_format = s->gb_buf.format;
s->use_mmap = 1;
}
Index: matroska.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/matroska.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- matroska.c 17 Dec 2005 18:14:37 -0000 1.18
+++ matroska.c 22 Dec 2005 01:10:11 -0000 1.19
@@ -597,8 +597,8 @@
static int
ebml_read_float (MatroskaDemuxContext *matroska,
- uint32_t *id,
- double *num)
+ uint32_t *id,
+ double *num)
{
ByteIOContext *pb = &matroska->ctx->pb;
int size, res;
@@ -905,7 +905,7 @@
if (num > sizeof(uint32_t)) {
av_log(matroska->ctx, AV_LOG_ERROR,
"IDs of size %"PRIu64" (> %zu) not supported\n",
- num, sizeof(uint32_t));
+ num, sizeof(uint32_t));
return AVERROR_INVALIDDATA;
}
break;
Index: mov.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/mov.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- mov.c 17 Dec 2005 18:14:37 -0000 1.95
+++ mov.c 22 Dec 2005 01:10:11 -0000 1.96
@@ -77,7 +77,7 @@
/* some streams in QT (and in MP4 mostly) aren't either video nor audio */
/* so we first list them as this, then clean up the list of streams we give back, */
/* getting rid of these */
-#define CODEC_TYPE_MOV_OTHER (enum CodecType) 2
+#define CODEC_TYPE_MOV_OTHER (enum CodecType) 2
static const CodecTag mov_video_tags[] = {
/* { CODEC_ID_, MKTAG('c', 'v', 'i', 'd') }, *//* Cinepak */
@@ -179,25 +179,25 @@
/* 0x03 ESDescrTag */
uint16_t es_id;
-#define MP4ODescrTag 0x01
-#define MP4IODescrTag 0x02
-#define MP4ESDescrTag 0x03
-#define MP4DecConfigDescrTag 0x04
-#define MP4DecSpecificDescrTag 0x05
-#define MP4SLConfigDescrTag 0x06
-#define MP4ContentIdDescrTag 0x07
-#define MP4SupplContentIdDescrTag 0x08
-#define MP4IPIPtrDescrTag 0x09
-#define MP4IPMPPtrDescrTag 0x0A
-#define MP4IPMPDescrTag 0x0B
-#define MP4RegistrationDescrTag 0x0D
-#define MP4ESIDIncDescrTag 0x0E
-#define MP4ESIDRefDescrTag 0x0F
-#define MP4FileIODescrTag 0x10
-#define MP4FileODescrTag 0x11
-#define MP4ExtProfileLevelDescrTag 0x13
-#define MP4ExtDescrTagsStart 0x80
-#define MP4ExtDescrTagsEnd 0xFE
+#define MP4ODescrTag 0x01
+#define MP4IODescrTag 0x02
+#define MP4ESDescrTag 0x03
+#define MP4DecConfigDescrTag 0x04
+#define MP4DecSpecificDescrTag 0x05
+#define MP4SLConfigDescrTag 0x06
+#define MP4ContentIdDescrTag 0x07
+#define MP4SupplContentIdDescrTag 0x08
+#define MP4IPIPtrDescrTag 0x09
+#define MP4IPMPPtrDescrTag 0x0A
+#define MP4IPMPDescrTag 0x0B
+#define MP4RegistrationDescrTag 0x0D
+#define MP4ESIDIncDescrTag 0x0E
+#define MP4ESIDRefDescrTag 0x0F
+#define MP4FileIODescrTag 0x10
+#define MP4FileODescrTag 0x11
+#define MP4ExtProfileLevelDescrTag 0x13
+#define MP4ExtDescrTagsStart 0x80
+#define MP4ExtDescrTagsEnd 0xFE
uint8_t stream_priority;
/* 0x04 DecConfigDescrTag */
@@ -322,7 +322,7 @@
(tag >> 16) & 0xff,
(tag >> 24) & 0xff,
(unsigned int)atom.offset,
- (unsigned int)atom.size);
+ (unsigned int)atom.size);
assert((unsigned int)atom.size < 0x7fffffff);// catching errors
}
#else
@@ -355,57 +355,57 @@
a.offset = atom.offset;
if (atom.size < 0)
- atom.size = 0x7fffffffffffffffLL;
+ atom.size = 0x7fffffffffffffffLL;
while(((total_size + 8) < atom.size) && !url_feof(pb) && !err) {
- a.size = atom.size;
- a.type=0L;
+ a.size = atom.size;
+ a.type=0L;
if(atom.size >= 8) {
- a.size = get_be32(pb);
+ a.size = get_be32(pb);
a.type = get_le32(pb);
}
- total_size += 8;
+ total_size += 8;
a.offset += 8;
- //av_log(NULL, AV_LOG_DEBUG, "type: %08x %.4s sz: %Lx %Lx %Lx\n", type, (char*)&type, size, atom.size, total_size);
+ //av_log(NULL, AV_LOG_DEBUG, "type: %08x %.4s sz: %Lx %Lx %Lx\n", type, (char*)&type, size, atom.size, total_size);
if (a.size == 1) { /* 64 bit extended size */
- a.size = get_be64(pb) - 8;
+ a.size = get_be64(pb) - 8;
a.offset += 8;
total_size += 8;
}
- if (a.size == 0) {
- a.size = atom.size - total_size;
- if (a.size <= 8)
+ if (a.size == 0) {
+ a.size = atom.size - total_size;
+ if (a.size <= 8)
break;
- }
- for (i = 0; c->parse_table[i].type != 0L
- && c->parse_table[i].type != a.type; i++)
- /* empty */;
+ }
+ for (i = 0; c->parse_table[i].type != 0L
+ && c->parse_table[i].type != a.type; i++)
+ /* empty */;
- a.size -= 8;
+ a.size -= 8;
if(a.size < 0)
break;
// av_log(NULL, AV_LOG_DEBUG, " i=%ld\n", i);
- if (c->parse_table[i].type == 0) { /* skip leaf atoms data */
+ if (c->parse_table[i].type == 0) { /* skip leaf atoms data */
// url_seek(pb, atom.offset+atom.size, SEEK_SET);
#ifdef DEBUG
print_atom("unknown", a);
#endif
url_fskip(pb, a.size);
- } else {
+ } else {
#ifdef DEBUG
- //char b[5] = { type & 0xff, (type >> 8) & 0xff, (type >> 16) & 0xff, (type >> 24) & 0xff, 0 };
- //print_atom(b, type, offset, size);
+ //char b[5] = { type & 0xff, (type >> 8) & 0xff, (type >> 16) & 0xff, (type >> 24) & 0xff, 0 };
+ //print_atom(b, type, offset, size);
#endif
- err = (c->parse_table[i].func)(c, pb, a);
- }
+ err = (c->parse_table[i].func)(c, pb, a);
+ }
- a.offset += a.size;
+ a.offset += a.size;
total_size += a.size;
}
if (!err && total_size < atom.size && atom.size < 0x7ffff) {
- //av_log(NULL, AV_LOG_DEBUG, "RESET %Ld %Ld err:%d\n", atom.size, total_size, err);
+ //av_log(NULL, AV_LOG_DEBUG, "RESET %Ld %Ld err:%d\n", atom.size, total_size, err);
url_fskip(pb, atom.size - total_size);
}
@@ -430,9 +430,9 @@
t->size = get_be16(pb) + 1;
len = 2 * t->size * 4;
if (len > 0) {
- t->clrs = av_malloc(len); // 16bit A R G B
- if (t->clrs)
- get_buffer(pb, t->clrs, len);
+ t->clrs = av_malloc(len); // 16bit A R G B
+ if (t->clrs)
+ get_buffer(pb, t->clrs, len);
}
#endif
@@ -512,15 +512,15 @@
#endif
len = get_byte(pb);
#ifdef DEBUG
- buf = (uint8_t*) av_malloc(len+1);
- if (buf) {
- get_buffer(pb, buf, len);
- buf[len] = '\0';
- av_log(NULL, AV_LOG_DEBUG, "**buf='%s'\n", buf);
- av_free(buf);
- } else
+ buf = (uint8_t*) av_malloc(len+1);
+ if (buf) {
+ get_buffer(pb, buf, len);
+ buf[len] = '\0';
+ av_log(NULL, AV_LOG_DEBUG, "**buf='%s'\n", buf);
+ av_free(buf);
+ } else
#endif
- url_fskip(pb, len);
+ url_fskip(pb, len);
}
url_fskip(pb, atom.size - (url_ftell(pb) - atom.offset));
@@ -533,9 +533,9 @@
int count = 4;
while (count--) {
int c = get_byte(pb);
- len = (len << 7) | (c & 0x7f);
- if (!(c & 0x80))
- break;
+ len = (len << 7) | (c & 0x7f);
+ if (!(c & 0x80))
+ break;
}
return len;
}
@@ -564,31 +564,31 @@
get_be32(pb); /* version + flags */
len = mov_mp4_read_descr(pb, &tag);
if (tag == MP4ESDescrTag) {
- get_be16(pb); /* ID */
- get_byte(pb); /* priority */
+ get_be16(pb); /* ID */
+ get_byte(pb); /* priority */
} else
- get_be16(pb); /* ID */
+ get_be16(pb); /* ID */
len = mov_mp4_read_descr(pb, &tag);
if (tag == MP4DecConfigDescrTag) {
- sc->esds.object_type_id = get_byte(pb);
- sc->esds.stream_type = get_byte(pb);
- sc->esds.buffer_size_db = get_be24(pb);
- sc->esds.max_bitrate = get_be32(pb);
- sc->esds.avg_bitrate = get_be32(pb);
+ sc->esds.object_type_id = get_byte(pb);
+ sc->esds.stream_type = get_byte(pb);
+ sc->esds.buffer_size_db = get_be24(pb);
+ sc->esds.max_bitrate = get_be32(pb);
+ sc->esds.avg_bitrate = get_be32(pb);
- len = mov_mp4_read_descr(pb, &tag);
- //av_log(NULL, AV_LOG_DEBUG, "LEN %d TAG %d m:%d a:%d\n", len, tag, sc->esds.max_bitrate, sc->esds.avg_bitrate);
- if (tag == MP4DecSpecificDescrTag) {
+ len = mov_mp4_read_descr(pb, &tag);
+ //av_log(NULL, AV_LOG_DEBUG, "LEN %d TAG %d m:%d a:%d\n", len, tag, sc->esds.max_bitrate, sc->esds.avg_bitrate);
+ if (tag == MP4DecSpecificDescrTag) {
#ifdef DEBUG
- av_log(NULL, AV_LOG_DEBUG, "Specific MPEG4 header len=%d\n", len);
+ av_log(NULL, AV_LOG_DEBUG, "Specific MPEG4 header len=%d\n", len);
#endif
- st->codec->extradata = (uint8_t*) av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
- if (st->codec->extradata) {
- get_buffer(pb, st->codec->extradata, len);
- st->codec->extradata_size = len;
- }
- }
+ st->codec->extradata = (uint8_t*) av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (st->codec->extradata) {
+ get_buffer(pb, st->codec->extradata, len);
+ st->codec->extradata_size = len;
+ }
+ }
}
/* in any case, skip garbage */
url_fskip(pb, atom.size - ((url_ftell(pb) - start_pos)));
@@ -701,11 +701,11 @@
st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (st->codec->extradata) {
- strcpy(st->codec->extradata, "SVQ3"); // fake
- get_buffer(pb, st->codec->extradata + 0x5a, atom.size);
- //av_log(NULL, AV_LOG_DEBUG, "Reading SMI %Ld %s\n", atom.size, (char*)st->codec->extradata + 0x5a);
+ strcpy(st->codec->extradata, "SVQ3"); // fake
+ get_buffer(pb, st->codec->extradata + 0x5a, atom.size);
+ //av_log(NULL, AV_LOG_DEBUG, "Reading SMI %Ld %s\n", atom.size, (char*)st->codec->extradata + 0x5a);
} else
- url_fskip(pb, atom.size);
+ url_fskip(pb, atom.size);
return 0;
}
@@ -723,10 +723,10 @@
st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (st->codec->extradata) {
- get_buffer(pb, st->codec->extradata, atom.size);
- //av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld %s\n", atom.size, (char*)st->codec->extradata);
+ get_buffer(pb, st->codec->extradata, atom.size);
+ //av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld %s\n", atom.size, (char*)st->codec->extradata);
} else
- url_fskip(pb, atom.size);
+ url_fskip(pb, atom.size);
return 0;
}
@@ -744,9 +744,9 @@
st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (st->codec->extradata) {
- get_buffer(pb, st->codec->extradata, atom.size);
+ get_buffer(pb, st->codec->extradata, atom.size);
} else
- url_fskip(pb, atom.size);
+ url_fskip(pb, atom.size);
return 0;
}
@@ -830,7 +830,7 @@
while(entries--) { //Parsing Sample description table
enum CodecID id;
- int size = get_be32(pb); /* size */
+ int size = get_be32(pb); /* size */
format = get_le32(pb); /* data format */
get_be32(pb); /* reserved */
@@ -841,9 +841,9 @@
id = codec_get_id(mov_video_tags, format);
if (id >= 0) {
AVCodec *codec;
- codec = avcodec_find_decoder(id);
+ codec = avcodec_find_decoder(id);
if (codec)
- st->codec->codec_type = codec->type;
+ st->codec->codec_type = codec->type;
}
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "size=%d 4CC= %c%c%c%c codec_type=%d\n",
@@ -854,9 +854,9 @@
(format >> 24) & 0xff,
st->codec->codec_type);
#endif
- st->codec->codec_tag = format;
- if(st->codec->codec_type==CODEC_TYPE_VIDEO) {
- MOV_atom_t a = { 0, 0, 0 };
+ st->codec->codec_tag = format;
+ if(st->codec->codec_type==CODEC_TYPE_VIDEO) {
+ MOV_atom_t a = { 0, 0, 0 };
st->codec->codec_id = id;
get_be16(pb); /* version */
get_be16(pb); /* revision level */
@@ -875,7 +875,7 @@
get_be32(pb); /* data size, always 0 */
frames_per_sample = get_be16(pb); /* frames per samples */
#ifdef DEBUG
- av_log(NULL, AV_LOG_DEBUG, "frames/samples = %d\n", frames_per_sample);
+ av_log(NULL, AV_LOG_DEBUG, "frames/samples = %d\n", frames_per_sample);
#endif
get_buffer(pb, codec_name, 32); /* codec name, pascal string (FIXME: true for mp4?) */
if (codec_name[0] <= 31) {
@@ -883,50 +883,50 @@
st->codec->codec_name[codec_name[0]] = 0;
}
- st->codec->bits_per_sample = get_be16(pb); /* depth */
+ st->codec->bits_per_sample = get_be16(pb); /* depth */
st->codec->color_table_id = get_be16(pb); /* colortable id */
/* These are set in mov_read_stts and might already be set!
st->codec->time_base.den = 25;
st->codec->time_base.num = 1;
*/
- size -= (16+8*4+2+32+2*2);
+ size -= (16+8*4+2+32+2*2);
#if 0
- while (size >= 8) {
- MOV_atom_t a;
+ while (size >= 8) {
+ MOV_atom_t a;
int64_t start_pos;
- a.size = get_be32(pb);
- a.type = get_le32(pb);
- size -= 8;
+ a.size = get_be32(pb);
+ a.type = get_le32(pb);
+ size -= 8;
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "VIDEO: atom_type=%c%c%c%c atom.size=%Ld size_left=%d\n",
(a.type >> 0) & 0xff,
(a.type >> 8) & 0xff,
(a.type >> 16) & 0xff,
(a.type >> 24) & 0xff,
- a.size, size);
+ a.size, size);
#endif
start_pos = url_ftell(pb);
- switch(a.type) {
+ switch(a.type) {
case MKTAG('e', 's', 'd', 's'):
{
int tag, len;
/* Well, broken but suffisant for some MP4 streams */
get_be32(pb); /* version + flags */
- len = mov_mp4_read_descr(pb, &tag);
+ len = mov_mp4_read_descr(pb, &tag);
if (tag == 0x03) {
/* MP4ESDescrTag */
get_be16(pb); /* ID */
get_byte(pb); /* priority */
- len = mov_mp4_read_descr(pb, &tag);
+ len = mov_mp4_read_descr(pb, &tag);
if (tag != 0x04)
goto fail;
/* MP4DecConfigDescrTag */
get_byte(pb); /* objectTypeId */
get_be32(pb); /* streamType + buffer size */
- get_be32(pb); /* max bit rate */
+ get_be32(pb); /* max bit rate */
get_be32(pb); /* avg bit rate */
len = mov_mp4_read_descr(pb, &tag);
if (tag != 0x05)
@@ -938,7 +938,7 @@
sc->header_data = av_mallocz(len);
if (sc->header_data) {
get_buffer(pb, sc->header_data, len);
- sc->header_len = len;
+ sc->header_len = len;
}
}
/* in any case, skip garbage */
@@ -947,14 +947,14 @@
default:
break;
}
- fail:
- av_log(NULL, AV_LOG_DEBUG, "ATOMENEWSIZE %Ld %d\n", atom.size, url_ftell(pb) - start_pos);
- if (atom.size > 8) {
- url_fskip(pb, (atom.size - 8) -
- ((url_ftell(pb) - start_pos)));
- size -= atom.size - 8;
- }
- }
+ fail:
+ av_log(NULL, AV_LOG_DEBUG, "ATOMENEWSIZE %Ld %d\n", atom.size, url_ftell(pb) - start_pos);
+ if (atom.size > 8) {
+ url_fskip(pb, (atom.size - 8) -
+ ((url_ftell(pb) - start_pos)));
+ size -= atom.size - 8;
+ }
+ }
if (size > 0) {
/* unknown extension */
url_fskip(pb, size);
@@ -1032,12 +1032,12 @@
st->codec->palctrl = NULL;
a.size = size;
- mov_read_default(c, pb, a);
+ mov_read_default(c, pb, a);
#endif
- } else {
+ } else {
st->codec->codec_id = codec_get_id(mov_audio_tags, format);
- if(st->codec->codec_id==CODEC_ID_AMR_NB || st->codec->codec_id==CODEC_ID_AMR_WB) //from TS26.244
- {
+ if(st->codec->codec_id==CODEC_ID_AMR_NB || st->codec->codec_id==CODEC_ID_AMR_WB) //from TS26.244
+ {
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "AMR-NB or AMR-WB audio identified!!\n");
#endif
@@ -1072,7 +1072,7 @@
st->codec->bits_per_sample=16;
st->codec->bit_rate=0; /*It is not possible to tell this before we have
an audio frame and even then every frame can be different*/
- }
+ }
else if( st->codec->codec_tag == MKTAG( 'm', 'p', '4', 's' ))
{
//This is some stuff for the hint track, lets ignore it!
@@ -1143,8 +1143,8 @@
av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
}
- else if(size>=(16+20))
- {//16 bytes read, reading atleast 20 more
+ else if(size>=(16+20))
+ {//16 bytes read, reading atleast 20 more
uint16_t version;
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "audio size=0x%X\n",size);
@@ -1153,27 +1153,27 @@
get_be16(pb); /* revision level */
get_be32(pb); /* vendor */
- st->codec->channels = get_be16(pb); /* channel count */
- st->codec->bits_per_sample = get_be16(pb); /* sample size */
+ st->codec->channels = get_be16(pb); /* channel count */
+ st->codec->bits_per_sample = get_be16(pb); /* sample size */
/* handle specific s8 codec */
get_be16(pb); /* compression id = 0*/
get_be16(pb); /* packet size = 0 */
st->codec->sample_rate = ((get_be32(pb) >> 16));
- //av_log(NULL, AV_LOG_DEBUG, "CODECID %d %d %.4s\n", st->codec->codec_id, CODEC_ID_PCM_S16BE, (char*)&format);
+ //av_log(NULL, AV_LOG_DEBUG, "CODECID %d %d %.4s\n", st->codec->codec_id, CODEC_ID_PCM_S16BE, (char*)&format);
- switch (st->codec->codec_id) {
- case CODEC_ID_PCM_S16BE:
- if (st->codec->bits_per_sample == 8)
- st->codec->codec_id = CODEC_ID_PCM_S8;
+ switch (st->codec->codec_id) {
+ case CODEC_ID_PCM_S16BE:
+ if (st->codec->bits_per_sample == 8)
+ st->codec->codec_id = CODEC_ID_PCM_S8;
/* fall */
- case CODEC_ID_PCM_U8:
- st->codec->bit_rate = st->codec->sample_rate * 8;
- break;
- default:
+ case CODEC_ID_PCM_U8:
+ st->codec->bit_rate = st->codec->sample_rate * 8;
+ break;
+ default:
;
- }
+ }
//Read QT version 1 fields. In version 0 theese dont exist
#ifdef DEBUG
@@ -1412,7 +1412,7 @@
if (!st) return -2;
sc = (MOVStreamContext*) av_mallocz(sizeof(MOVStreamContext));
if (!sc) {
- av_free(st);
+ av_free(st);
return -1;
}
@@ -1738,9 +1738,9 @@
mov->mp4 = 1;
#endif
if(!url_is_streamed(pb)) /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
- atom.size = url_fsize(pb);
+ atom.size = url_fsize(pb);
else
- atom.size = 0x7FFFFFFFFFFFFFFFLL;
+ atom.size = 0x7FFFFFFFFFFFFFFFLL;
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "filesz=%Ld\n", atom.size);
@@ -1749,9 +1749,9 @@
/* check MOV header */
err = mov_read_default(mov, pb, atom);
if (err<0 || (!mov->found_moov && !mov->found_mdat)) {
- av_log(s, AV_LOG_ERROR, "mov: header not found !!! (err:%d, moov:%d, mdat:%d) pos:%"PRId64"\n",
- err, mov->found_moov, mov->found_mdat, url_ftell(pb));
- return -1;
+ av_log(s, AV_LOG_ERROR, "mov: header not found !!! (err:%d, moov:%d, mdat:%d) pos:%"PRId64"\n",
+ err, mov->found_moov, mov->found_mdat, url_ftell(pb));
+ return -1;
}
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "on_parse_exit_offset=%d\n", (int) url_ftell(pb));
@@ -1809,8 +1809,8 @@
#ifdef MOV_SPLIT_CHUNKS
if (mov->partial) {
- sc = mov->partial;
- idx = sc->sample_to_chunk_index;
+ sc = mov->partial;
+ idx = sc->sample_to_chunk_index;
if (idx < 0) return 0;
#ifdef DEBUG
@@ -1838,7 +1838,7 @@
if(offset == INT64_MAX)
best_dts= INT64_MAX;
for(i=0; i<mov->total_streams; i++) {
- MOVStreamContext *msc = mov->streams[i];
+ MOVStreamContext *msc = mov->streams[i];
if ((msc->next_chunk < msc->chunk_count) && msc->next_chunk >= 0){
if (msc->sample_to_time_index < msc->stts_count && mov->ni) {
@@ -1873,7 +1873,7 @@
}
}
if (!sc || offset==INT64_MAX)
- return -1;
+ return -1;
sc->next_chunk++;
@@ -1886,18 +1886,18 @@
if(!sc->is_ff_stream || (s->streams[sc->ffindex]->discard >= AVDISCARD_ALL)) {
url_fskip(&s->pb, (offset - mov->next_chunk_offset));
mov->next_chunk_offset = offset;
- offset = INT64_MAX;
+ offset = INT64_MAX;
goto again;
}
/* now get the chunk size... */
for(i=0; i<mov->total_streams; i++) {
- MOVStreamContext *msc = mov->streams[i];
- if ((msc->next_chunk < msc->chunk_count)
+ MOVStreamContext *msc = mov->streams[i];
+ if ((msc->next_chunk < msc->chunk_count)
&& msc->chunk_offsets[msc->next_chunk] - offset < size
&& msc->chunk_offsets[msc->next_chunk] > offset)
- size = msc->chunk_offsets[msc->next_chunk] - offset;
+ size = msc->chunk_offsets[msc->next_chunk] - offset;
}
#ifdef MOV_MINOLTA_FIX
@@ -1910,13 +1910,13 @@
for(i=0; i<(sc->sample_to_chunk_sz); i++) {
if( (sc->sample_to_chunk[i].first)<=(sc->next_chunk) )
{
- // I can't figure out why for PCM audio sample_size is always 1
- // (it should actually be channels*bits_per_second/8) but it is.
- AVCodecContext* cod = s->streams[sc->ffindex]->codec;
+ // I can't figure out why for PCM audio sample_size is always 1
+ // (it should actually be channels*bits_per_second/8) but it is.
+ AVCodecContext* cod = s->streams[sc->ffindex]->codec;
if (sc->sample_size == 1 && (cod->codec_id == CODEC_ID_PCM_S16BE || cod->codec_id == CODEC_ID_PCM_S16LE))
- foundsize=(sc->sample_to_chunk[i].count*cod->channels*cod->bits_per_sample)/8;
- else
- foundsize=sc->sample_to_chunk[i].count*sc->sample_size;
+ foundsize=(sc->sample_to_chunk[i].count*cod->channels*cod->bits_per_sample)/8;
+ else
+ foundsize=sc->sample_to_chunk[i].count*sc->sample_size;
}
#ifdef DEBUG
av_log(NULL, AV_LOG_DEBUG, "sample_to_chunk first=%ld count=%ld, id=%ld\n", sc->sample_to_chunk[i].first, sc->sample_to_chunk[i].count, sc->sample_to_chunk[i].id);
@@ -1940,7 +1940,7 @@
/* split chunks into samples */
if (sc->sample_size == 0 || sc->sample_size > 100) {
if (idx >= 0 && sc->sample_to_chunk[idx].count != 1) {
- mov->partial = sc;
+ mov->partial = sc;
/* we'll have to get those samples before next chunk */
sc->left_in_chunk = sc->sample_to_chunk[idx].count - 1;
size = (sc->sample_size > 1)?sc->sample_size:sc->sample_sizes[sc->current_sample];
@@ -2274,7 +2274,7 @@
mov_free_stream_context(mov->streams[i]);
/* free color tabs */
for(i=0; i<mov->ctab_size; i++)
- av_freep(&mov->ctab[i]);
+ av_freep(&mov->ctab[i]);
av_freep(&mov->ctab);
return 0;
}
Index: movenc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/movenc.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- movenc.c 17 Dec 2005 18:14:37 -0000 1.45
+++ movenc.c 22 Dec 2005 01:10:11 -0000 1.46
@@ -287,7 +287,7 @@
// if no mac fcc found, try with Microsoft tags
if (!tag)
{
- int tmp = codec_get_tag(codec_wav_tags, track->enc->codec_id);
+ int tmp = codec_get_tag(codec_wav_tags, track->enc->codec_id);
tag = MKTAG('m', 's', ((tmp >> 8) & 0xff), (tmp & 0xff));
}
put_le32(pb, tag); // store it byteswapped
@@ -515,7 +515,7 @@
tag = codec_get_tag(codec_movvideo_tags, track->enc->codec_id);
// if no mac fcc found, try with Microsoft tags
if (!tag)
- tag = codec_get_tag(codec_bmp_tags, track->enc->codec_id);
+ tag = codec_get_tag(codec_bmp_tags, track->enc->codec_id);
put_le32(pb, tag); // store it byteswapped
put_be32(pb, 0); /* Reserved */
@@ -649,18 +649,18 @@
int pos = url_ftell(pb);
if (!track) { /* no media --> data handler */
- hdlr = "dhlr";
- hdlr_type = "url ";
- descr = "DataHandler";
+ hdlr = "dhlr";
+ hdlr_type = "url ";
+ descr = "DataHandler";
} else {
- hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
- if (track->enc->codec_type == CODEC_TYPE_VIDEO) {
- hdlr_type = "vide";
- descr = "VideoHandler";
- } else {
- hdlr_type = "soun";
- descr = "SoundHandler";
- }
+ hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
+ if (track->enc->codec_type == CODEC_TYPE_VIDEO) {
+ hdlr_type = "vide";
+ descr = "VideoHandler";
+ } else {
+ hdlr_type = "soun";
+ descr = "SoundHandler";
+ }
}
put_be32(pb, 0); /* size */
@@ -1394,8 +1394,8 @@
else if(enc->codec_id == CODEC_ID_PCM_ALAW) {
samplesInChunk = size/enc->channels;
}
- else if(enc->codec_id == CODEC_ID_PCM_S16BE || enc->codec_id == CODEC_ID_PCM_S16LE) {
- samplesInChunk = size/(2*enc->channels);
+ else if(enc->codec_id == CODEC_ID_PCM_S16BE || enc->codec_id == CODEC_ID_PCM_S16LE) {
+ samplesInChunk = size/(2*enc->channels);
}
else {
samplesInChunk = 1;
Index: mpegtsenc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/mpegtsenc.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- mpegtsenc.c 17 Dec 2005 18:14:37 -0000 1.10
+++ mpegtsenc.c 22 Dec 2005 01:10:11 -0000 1.11
@@ -23,49 +23,49 @@
/* write DVB SI sections */
static const uint32_t crc_table[256] = {
- 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
- 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
- 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7,
- 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
- 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3,
- 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
- 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef,
- 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
- 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb,
- 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
- 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0,
- 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
- 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4,
- 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
- 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08,
- 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
- 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc,
- 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
- 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050,
- 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
- 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34,
- 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
- 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1,
- 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
- 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5,
- 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
- 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9,
- 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
- 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd,
- 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
- 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71,
- 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
- 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2,
- 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
- 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e,
- 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
- 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a,
- 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
- 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676,
- 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
- 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662,
- 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
- 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
+ 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
+ 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7,
+ 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
+ 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3,
+ 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+ 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef,
+ 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
+ 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb,
+ 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
+ 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0,
+ 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
+ 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4,
+ 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
+ 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08,
+ 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+ 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc,
+ 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
+ 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050,
+ 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
+ 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34,
+ 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
+ 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1,
+ 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
+ 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5,
+ 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+ 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9,
+ 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
+ 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd,
+ 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
+ 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71,
+ 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
+ 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2,
+ 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
+ 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e,
+ 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+ 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a,
+ 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
+ 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676,
+ 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
+ 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662,
+ 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
+ 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
unsigned int mpegts_crc32(const uint8_t *data, int len)
Index: nsvdec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/nsvdec.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- nsvdec.c 17 Dec 2005 18:14:37 -0000 1.12
+++ nsvdec.c 22 Dec 2005 01:10:11 -0000 1.13
@@ -663,7 +663,7 @@
/* now pick one of the plates */
for (i = 0; i < 2; i++) {
if (nsv->ahead[i].data) {
- PRINT(("%s: using cached packet[%d]\n", __FUNCTION__, i));
+ PRINT(("%s: using cached packet[%d]\n", __FUNCTION__, i));
/* avoid the cost of new_packet + memcpy(->data) */
memcpy(pkt, &nsv->ahead[i], sizeof(AVPacket));
nsv->ahead[i].data = NULL; /* we ate that one */
Index: nut.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/nut.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- nut.c 17 Dec 2005 18:14:37 -0000 1.58
+++ nut.c 22 Dec 2005 01:10:11 -0000 1.59
@@ -92,23 +92,23 @@
} NUTContext;
static char *info_table[][2]={
- {NULL , NULL }, // end
- {NULL , NULL },
- {NULL , "UTF8"},
- {NULL , "v"},
- {NULL , "s"},
- {"StreamId" , "v"},
- {"SegmentId" , "v"},
- {"StartTimestamp" , "v"},
- {"EndTimestamp" , "v"},
- {"Author" , "UTF8"},
- {"Title" , "UTF8"},
- {"Description" , "UTF8"},
- {"Copyright" , "UTF8"},
- {"Encoder" , "UTF8"},
- {"Keyword" , "UTF8"},
- {"Cover" , "JPEG"},
- {"Cover" , "PNG"},
+ {NULL , NULL }, // end
+ {NULL , NULL },
+ {NULL , "UTF8"},
+ {NULL , "v"},
+ {NULL , "s"},
+ {"StreamId" , "v"},
+ {"SegmentId" , "v"},
+ {"StartTimestamp" , "v"},
+ {"EndTimestamp" , "v"},
+ {"Author" , "UTF8"},
+ {"Title" , "UTF8"},
+ {"Description" , "UTF8"},
+ {"Copyright" , "UTF8"},
+ {"Encoder" , "UTF8"},
+ {"Keyword" , "UTF8"},
+ {"Cover" , "JPEG"},
+ {"Cover" , "PNG"},
};
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);
@@ -244,13 +244,13 @@
for(;;)
{
- int tmp = get_byte(bc);
+ int tmp = get_byte(bc);
- if (tmp&0x80)
- val= (val<<7) + tmp - 0x80;
- else{
+ if (tmp&0x80)
+ val= (val<<7) + tmp - 0x80;
+ else{
//av_log(NULL, AV_LOG_DEBUG, "get_v()= %lld\n", (val<<7) + tmp);
- return (val<<7) + tmp;
+ return (val<<7) + tmp;
}
}
return -1;
@@ -405,7 +405,7 @@
i= get_length(val);
for (i-=7; i>0; i-=7){
- put_byte(bc, 0x80 | (val>>i));
+ put_byte(bc, 0x80 | (val>>i));
}
put_byte(bc, val&0x7f);
@@ -516,7 +516,7 @@
nut->avf= s;
nut->stream =
- av_mallocz(sizeof(StreamContext)*s->nb_streams);
+ av_mallocz(sizeof(StreamContext)*s->nb_streams);
put_buffer(bc, ID_STRING, strlen(ID_STRING));
@@ -580,13 +580,13 @@
/* stream headers */
for (i = 0; i < s->nb_streams; i++)
{
- int nom, denom, ssize;
+ int nom, denom, ssize;
- codec = s->streams[i]->codec;
+ codec = s->streams[i]->codec;
- put_be64(bc, STREAM_STARTCODE);
- put_packetheader(nut, bc, 120 + codec->extradata_size, 1);
- put_v(bc, i /*s->streams[i]->index*/);
+ put_be64(bc, STREAM_STARTCODE);
+ put_packetheader(nut, bc, 120 + codec->extradata_size, 1);
+ put_v(bc, i /*s->streams[i]->index*/);
switch(codec->codec_type){
case CODEC_TYPE_VIDEO: put_v(bc, 0); break;
case CODEC_TYPE_AUDIO: put_v(bc, 1); break;
@@ -594,16 +594,16 @@
case CODEC_TYPE_DATA : put_v(bc, 3); break;
default: return -1;
}
- if (codec->codec_tag)
- put_vb(bc, codec->codec_tag);
- else if (codec->codec_type == CODEC_TYPE_VIDEO)
- {
- put_vb(bc, codec_get_bmp_tag(codec->codec_id));
- }
- else if (codec->codec_type == CODEC_TYPE_AUDIO)
- {
- put_vb(bc, codec_get_wav_tag(codec->codec_id));
- }
+ if (codec->codec_tag)
+ put_vb(bc, codec->codec_tag);
+ else if (codec->codec_type == CODEC_TYPE_VIDEO)
+ {
+ put_vb(bc, codec_get_bmp_tag(codec->codec_id));
+ }
+ else if (codec->codec_type == CODEC_TYPE_AUDIO)
+ {
+ put_vb(bc, codec_get_wav_tag(codec->codec_id));
+ }
else
put_vb(bc, 0);
@@ -613,42 +613,42 @@
nut->stream[i].rate_den= denom;
av_set_pts_info(s->streams[i], 60, denom, nom);
- put_v(bc, codec->bit_rate);
- put_vb(bc, 0); /* no language code */
- put_v(bc, nom);
- put_v(bc, denom);
+ put_v(bc, codec->bit_rate);
+ put_vb(bc, 0); /* no language code */
+ put_v(bc, nom);
+ put_v(bc, denom);
if(nom / denom < 1000)
- nut->stream[i].msb_timestamp_shift = 7;
+ nut->stream[i].msb_timestamp_shift = 7;
else
- nut->stream[i].msb_timestamp_shift = 14;
- put_v(bc, nut->stream[i].msb_timestamp_shift);
+ nut->stream[i].msb_timestamp_shift = 14;
+ put_v(bc, nut->stream[i].msb_timestamp_shift);
put_v(bc, codec->has_b_frames);
- put_byte(bc, 0); /* flags: 0x1 - fixed_fps, 0x2 - index_present */
+ put_byte(bc, 0); /* flags: 0x1 - fixed_fps, 0x2 - index_present */
if(codec->extradata_size){
put_v(bc, 1);
put_v(bc, codec->extradata_size);
put_buffer(bc, codec->extradata, codec->extradata_size);
}
- put_v(bc, 0); /* end of codec specific headers */
+ put_v(bc, 0); /* end of codec specific headers */
- switch(codec->codec_type)
- {
- case CODEC_TYPE_AUDIO:
- put_v(bc, codec->sample_rate);
- put_v(bc, 1);
- put_v(bc, codec->channels);
- break;
- case CODEC_TYPE_VIDEO:
- put_v(bc, codec->width);
- put_v(bc, codec->height);
- put_v(bc, codec->sample_aspect_ratio.num);
- put_v(bc, codec->sample_aspect_ratio.den);
- put_v(bc, 0); /* csp type -- unknown */
- break;
+ switch(codec->codec_type)
+ {
+ case CODEC_TYPE_AUDIO:
+ put_v(bc, codec->sample_rate);
+ put_v(bc, 1);
+ put_v(bc, codec->channels);
+ break;
+ case CODEC_TYPE_VIDEO:
+ put_v(bc, codec->width);
+ put_v(bc, codec->height);
+ put_v(bc, codec->sample_aspect_ratio.num);
+ put_v(bc, codec->sample_aspect_ratio.den);
+ put_v(bc, 0); /* csp type -- unknown */
+ break;
default:
break;
- }
+ }
update_packetheader(nut, bc, 0, 1);
}
@@ -722,7 +722,7 @@
if(frame_type>1){
int64_t global_ts= av_rescale(pts, stream->rate_den*(int64_t)nut->rate_num, stream->rate_num*(int64_t)nut->rate_den);
reset(s, global_ts);
- put_be64(bc, KEYFRAME_STARTCODE);
+ put_be64(bc, KEYFRAME_STARTCODE);
put_v(bc, global_ts);
}
assert(stream->last_pts != AV_NOPTS_VALUE);
@@ -829,10 +829,10 @@
for (i = 0; s->nb_streams; i++)
{
- put_be64(bc, INDEX_STARTCODE);
- put_packetheader(nut, bc, 64, 1);
- put_v(bc, s->streams[i]->id);
- put_v(bc, ...);
+ put_be64(bc, INDEX_STARTCODE);
+ put_packetheader(nut, bc, 64, 1);
+ put_v(bc, s->streams[i]->id);
+ put_v(bc, ...);
update_packetheader(nut, bc, 0, 1);
}
#endif
@@ -868,7 +868,7 @@
tmp = get_v(bc);
if (tmp != 2){
- av_log(s, AV_LOG_ERROR, "bad version (%"PRId64")\n", tmp);
+ av_log(s, AV_LOG_ERROR, "bad version (%"PRId64")\n", tmp);
return -1;
}
@@ -883,7 +883,7 @@
nut->rate_den= get_v(bc);
nut->short_startcode= get_v(bc);
if(nut->short_startcode>>16 != 'N'){
- av_log(s, AV_LOG_ERROR, "invalid short startcode %X\n", nut->short_startcode);
+ av_log(s, AV_LOG_ERROR, "invalid short startcode %X\n", nut->short_startcode);
return -1;
}
@@ -994,7 +994,7 @@
return -1;
st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(bc, st->codec->extradata, st->codec->extradata_size);
-// url_fskip(bc, get_v(bc));
+// url_fskip(bc, get_v(bc));
}
if (st->codec->codec_type == CODEC_TYPE_VIDEO) /* VIDEO */
@@ -1242,7 +1242,7 @@
av_get_packet(bc, pkt, size);
pkt->stream_index = stream_id;
if (key_frame)
- pkt->flags |= PKT_FLAG_KEY;
+ pkt->flags |= PKT_FLAG_KEY;
pkt->pts = pts;
return 0;
Index: ogg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/ogg.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ogg.c 17 Dec 2005 18:14:37 -0000 1.28
+++ ogg.c 22 Dec 2005 01:10:11 -0000 1.29
@@ -73,7 +73,7 @@
op->packetno++; //FIXME multiple streams
}
- context->header_handled = 0 ;
+ context->header_handled = 0 ;
}
return 0 ;
@@ -94,12 +94,12 @@
/* flush header packets so audio starts on a new page */
if(!context->header_handled) {
- while(ogg_stream_flush(&context->os, &og)) {
- put_buffer(&avfcontext->pb, og.header, og.header_len) ;
- put_buffer(&avfcontext->pb, og.body, og.body_len) ;
- put_flush_packet(&avfcontext->pb);
- }
- context->header_handled = 1 ;
+ while(ogg_stream_flush(&context->os, &og)) {
+ put_buffer(&avfcontext->pb, og.header, og.header_len) ;
+ put_buffer(&avfcontext->pb, og.body, og.body_len) ;
+ put_flush_packet(&avfcontext->pb);
+ }
+ context->header_handled = 1 ;
}
op->packet = (uint8_t*) pkt->data;
@@ -113,8 +113,8 @@
while(ogg_stream_pageout(&context->os, &og)) {
put_buffer(&avfcontext->pb, og.header, og.header_len);
- put_buffer(&avfcontext->pb, og.body, og.body_len);
- put_flush_packet(&avfcontext->pb);
+ put_buffer(&avfcontext->pb, og.body, og.body_len);
+ put_flush_packet(&avfcontext->pb);
}
op->packetno++;
@@ -127,9 +127,9 @@
ogg_page og ;
while(ogg_stream_flush(&context->os, &og)) {
- put_buffer(&avfcontext->pb, og.header, og.header_len) ;
- put_buffer(&avfcontext->pb, og.body, og.body_len) ;
- put_flush_packet(&avfcontext->pb);
+ put_buffer(&avfcontext->pb, og.header, og.header_len) ;
+ put_buffer(&avfcontext->pb, og.body, og.body_len) ;
+ put_flush_packet(&avfcontext->pb);
}
ogg_stream_clear(&context->os) ;
@@ -159,17 +159,17 @@
while(ogg_stream_packetout(&context->os, op) != 1) {
- /* while no pages are available, read in more data to the sync */
- while(ogg_sync_pageout(&context->oy, &og) != 1) {
- buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;
- if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0)
- return 1 ;
- ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
- }
+ /* while no pages are available, read in more data to the sync */
+ while(ogg_sync_pageout(&context->oy, &og) != 1) {
+ buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;
+ if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0)
+ return 1 ;
+ ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
+ }
- /* got a page. Feed it into the stream and get the packet */
- if(ogg_stream_pagein(&context->os, &og) != 0)
- return 1 ;
+ /* got a page. Feed it into the stream and get the packet */
+ if(ogg_stream_pagein(&context->os, &og) != 0)
+ return 1 ;
}
return 0 ;
@@ -191,7 +191,7 @@
buf = ogg_sync_buffer(&context->oy, DECODER_BUFFER_SIZE) ;
if(get_buffer(&avfcontext->pb, buf, DECODER_BUFFER_SIZE) <= 0)
- return AVERROR_IO ;
+ return AVERROR_IO ;
ogg_sync_wrote(&context->oy, DECODER_BUFFER_SIZE) ;
ogg_sync_pageout(&context->oy, &og) ;
@@ -202,7 +202,7 @@
ast = av_new_stream(avfcontext, 0) ;
if(!ast)
- return AVERROR_NOMEM ;
+ return AVERROR_NOMEM ;
av_set_pts_info(ast, 60, 1, AV_TIME_BASE);
codec= &ast->codec;
@@ -231,9 +231,9 @@
ogg_packet op ;
if(next_packet(avfcontext, &op))
- return AVERROR_IO ;
+ return AVERROR_IO ;
if(av_new_packet(pkt, op.bytes) < 0)
- return AVERROR_IO ;
+ return AVERROR_IO ;
pkt->stream_index = 0 ;
memcpy(pkt->data, op.packet, op.bytes);
if(avfcontext->streams[0]->codec.sample_rate && op.granulepos!=-1)
Index: ogg2.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/ogg2.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ogg2.c 17 Dec 2005 18:14:37 -0000 1.12
+++ ogg2.c 22 Dec 2005 01:10:11 -0000 1.13
@@ -434,7 +434,7 @@
uint64_t pts = AV_NOPTS_VALUE;
if(os->codec->gptopts){
- pts = os->codec->gptopts(s, i, gp);
+ pts = os->codec->gptopts(s, i, gp);
} else if (codec->codec_type == CODEC_TYPE_AUDIO){
pts = gp * 1000000LL / codec->sample_rate;
}else if (codec->codec_type == CODEC_TYPE_VIDEO){
Index: oggparsetheora.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/oggparsetheora.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- oggparsetheora.c 17 Dec 2005 18:14:37 -0000 1.4
+++ oggparsetheora.c 22 Dec 2005 01:10:11 -0000 1.5
@@ -47,8 +47,8 @@
return 0;
if(!thp){
- thp = av_mallocz(sizeof(*thp));
- os->private = thp;
+ thp = av_mallocz(sizeof(*thp));
+ os->private = thp;
}
if (os->buf[os->pstart] == 0x80) {
@@ -74,7 +74,7 @@
skip_bits(&gb, 38);
thp->gpshift = get_bits(&gb, 5);
- thp->gpmask = (1 << thp->gpshift) - 1;
+ thp->gpmask = (1 << thp->gpshift) - 1;
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_THEORA;
Index: raw.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/raw.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- raw.c 17 Dec 2005 18:14:37 -0000 1.60
+++ raw.c 22 Dec 2005 01:10:11 -0000 1.61
@@ -127,7 +127,7 @@
int ret, size, w, h, unk1, unk2;
if (get_le32(&s->pb) != MKTAG('M', 'J', 'P', 'G'))
- return AVERROR_IO; // FIXME
+ return AVERROR_IO; // FIXME
size = get_le32(&s->pb);
@@ -141,7 +141,7 @@
url_fskip(&s->pb, 22); // ascii timestamp
av_log(NULL, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
- size, w, h, unk1, unk2);
+ size, w, h, unk1, unk2);
if (av_new_packet(pkt, size) < 0)
return AVERROR_IO;
@@ -283,9 +283,9 @@
return 0;
}
-#define SEQ_START_CODE 0x000001b3
-#define GOP_START_CODE 0x000001b8
-#define PICTURE_START_CODE 0x00000100
+#define SEQ_START_CODE 0x000001b3
+#define GOP_START_CODE 0x000001b8
+#define PICTURE_START_CODE 0x00000100
/* XXX: improve that by looking at several start codes */
static int mpegvideo_probe(AVProbeData *p)
Index: rm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/rm.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- rm.c 19 Dec 2005 20:49:00 -0000 1.53
+++ rm.c 22 Dec 2005 01:10:11 -0000 1.54
@@ -538,15 +538,15 @@
st->codec->channels = get_be16(pb);
if (((version >> 16) & 0xff) == 5) {
get_be32(pb);
- buf[0] = get_byte(pb);
- buf[1] = get_byte(pb);
- buf[2] = get_byte(pb);
- buf[3] = get_byte(pb);
- buf[4] = 0;
- } else {
+ buf[0] = get_byte(pb);
+ buf[1] = get_byte(pb);
+ buf[2] = get_byte(pb);
+ buf[3] = get_byte(pb);
+ buf[4] = 0;
+ } else {
get_str8(pb, buf, sizeof(buf)); /* desc */
get_str8(pb, buf, sizeof(buf)); /* desc */
- }
+ }
st->codec->codec_type = CODEC_TYPE_AUDIO;
if (!strcmp(buf, "dnet")) {
st->codec->codec_id = CODEC_ID_AC3;
Index: rtpproto.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/rtpproto.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- rtpproto.c 17 Dec 2005 18:14:37 -0000 1.10
+++ rtpproto.c 22 Dec 2005 01:10:11 -0000 1.11
@@ -87,8 +87,8 @@
}
static void build_udp_url(char *buf, int buf_size,
- const char *hostname, int port,
- int local_port, int multicast, int ttl)
+ const char *hostname, int port,
+ int local_port, int multicast, int ttl)
{
snprintf(buf, buf_size, "udp://%s:%d", hostname, port);
if (local_port >= 0)
Index: rtsp.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/rtsp.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- rtsp.c 17 Dec 2005 18:14:37 -0000 1.24
+++ rtsp.c 22 Dec 2005 01:10:11 -0000 1.25
@@ -296,7 +296,7 @@
get_word_sep(value, sizeof(value), ";", &p);
if (*p == ';')
p++;
- /* grab the codec extra_data from the config parameter of the fmtp line */
+ /* grab the codec extra_data from the config parameter of the fmtp line */
sdp_parse_fmtp_config(codec, attr, value);
/* Looking for a known attribute */
for (i = 0; attr_names[i].str; ++i) {
@@ -305,7 +305,7 @@
*(int *)((char *)rtp_payload_data + attr_names[i].offset) = atoi(value);
else if (attr_names[i].type == ATTR_NAME_TYPE_STR)
*(char **)((char *)rtp_payload_data + attr_names[i].offset) = av_strdup(value);
- }
+ }
}
}
}
Index: sierravmd.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/sierravmd.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- sierravmd.c 17 Dec 2005 18:14:37 -0000 1.12
+++ sierravmd.c 22 Dec 2005 01:10:11 -0000 1.13
@@ -186,7 +186,7 @@
/* each on-disk VMD frame has an audio part and a video part; demuxer
* accounts them separately */
if(vmd->sample_rate)
- vmd->frame_count *= 2;
+ vmd->frame_count *= 2;
raw_frame_table = NULL;
vmd->frame_table = NULL;
raw_frame_table_size = vmd->frame_count * BYTES_PER_FRAME_RECORD;
Index: swf.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/swf.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- swf.c 17 Dec 2005 18:14:37 -0000 1.30
+++ swf.c 22 Dec 2005 01:10:11 -0000 1.31
@@ -35,7 +35,7 @@
#define TAG_JPEG2 21
#define TAG_PLACEOBJECT2 26
#define TAG_STREAMHEAD2 45
-#define TAG_VIDEOSTREAM 60
+#define TAG_VIDEOSTREAM 60
#define TAG_VIDEOFRAME 61
#define TAG_LONG 0x100
@@ -45,7 +45,7 @@
#define FLAG_SETFILL0 0x02
#define FLAG_SETFILL1 0x04
-#define SWF_VIDEO_CODEC_FLV1 0x02
+#define SWF_VIDEO_CODEC_FLV1 0x02
#define AUDIO_FIFO_SIZE 65536
@@ -749,7 +749,7 @@
if (tag == MKBETAG('C', 'W', 'S', 0))
{
- av_log(s, AV_LOG_ERROR, "Compressed SWF format not supported\n");
+ av_log(s, AV_LOG_ERROR, "Compressed SWF format not supported\n");
return AVERROR_IO;
}
if (tag != MKBETAG('F', 'W', 'S', 0))
@@ -862,7 +862,7 @@
return AVERROR_IO;
if (tag == TAG_VIDEOFRAME) {
for( i=0; i<s->nb_streams; i++ ) {
- st = s->streams[i];
+ st = s->streams[i];
if (st->id == 0) {
if ( get_le16(pb) == swf->ch_id ) {
frame = get_le16(pb);
@@ -879,7 +879,7 @@
url_fskip(pb, len);
} else if (tag == TAG_STREAMBLOCK) {
for( i=0; i<s->nb_streams; i++ ) {
- st = s->streams[i];
+ st = s->streams[i];
if (st->id == 1) {
av_get_packet(pb, pkt, len);
pkt->stream_index = st->index;
Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- utils.c 17 Dec 2005 18:14:37 -0000 1.171
+++ utils.c 22 Dec 2005 01:10:11 -0000 1.172
@@ -2696,10 +2696,10 @@
/* First, we check our abbreviation table */
for (i = 0; i < sizeof(frame_abvs)/sizeof(*frame_abvs); ++i)
if (!strcmp(frame_abvs[i].abv, arg)) {
- *frame_rate = frame_abvs[i].frame_rate;
- *frame_rate_base = frame_abvs[i].frame_rate_base;
- return 0;
- }
+ *frame_rate = frame_abvs[i].frame_rate;
+ *frame_rate_base = frame_abvs[i].frame_rate_base;
+ return 0;
+ }
/* Then, we try to parse it as fraction */
cp = strchr(arg, '/');
@@ -2707,11 +2707,11 @@
cp = strchr(arg, ':');
if (cp) {
char* cpp;
- *frame_rate = strtol(arg, &cpp, 10);
- if (cpp != arg || cpp == cp)
- *frame_rate_base = strtol(cp+1, &cpp, 10);
- else
- *frame_rate = 0;
+ *frame_rate = strtol(arg, &cpp, 10);
+ if (cpp != arg || cpp == cp)
+ *frame_rate_base = strtol(cp+1, &cpp, 10);
+ else
+ *frame_rate = 0;
}
else {
/* Finally we give up and parse it as double */
@@ -2801,10 +2801,10 @@
}
}
} else {
- if (p[0] == '-') {
- negative = 1;
- ++p;
- }
+ if (p[0] == '-') {
+ negative = 1;
+ ++p;
+ }
q = small_strptime(p, time_fmt[0], &dt);
if (!q) {
dt.tm_sec = strtol(p, (char **)&q, 10);
Index: wav.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/wav.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- wav.c 17 Dec 2005 18:14:37 -0000 1.57
+++ wav.c 22 Dec 2005 01:10:11 -0000 1.58
@@ -163,18 +163,18 @@
codec->codec_id = wav_codec_get_id(id, codec->bits_per_sample);
if (size > 16) { /* We're obviously dealing with WAVEFORMATEX */
- codec->extradata_size = get_le16(pb);
- if (codec->extradata_size > 0) {
- if (codec->extradata_size > size - 18)
- codec->extradata_size = size - 18;
+ codec->extradata_size = get_le16(pb);
+ if (codec->extradata_size > 0) {
+ if (codec->extradata_size > size - 18)
+ codec->extradata_size = size - 18;
codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
get_buffer(pb, codec->extradata, codec->extradata_size);
} else
- codec->extradata_size = 0;
+ codec->extradata_size = 0;
- /* It is possible for the chunk to contain garbage at the end */
- if (size - codec->extradata_size - 18 > 0)
- url_fskip(pb, size - codec->extradata_size - 18);
+ /* It is possible for the chunk to contain garbage at the end */
+ if (size - codec->extradata_size - 18 > 0)
+ url_fskip(pb, size - codec->extradata_size - 18);
}
}
Index: wc3movie.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/wc3movie.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- wc3movie.c 17 Dec 2005 18:14:37 -0000 1.13
+++ wc3movie.c 22 Dec 2005 01:10:11 -0000 1.14
@@ -360,7 +360,7 @@
break;
default:
- av_log (s, AV_LOG_ERROR, " unrecognized WC3 chunk: %c%c%c%c (0x%02X%02X%02X%02X)\n",
+ av_log (s, AV_LOG_ERROR, " unrecognized WC3 chunk: %c%c%c%c (0x%02X%02X%02X%02X)\n",
preamble[0], preamble[1], preamble[2], preamble[3],
preamble[0], preamble[1], preamble[2], preamble[3]);
ret = AVERROR_INVALIDDATA;
Index: yuv4mpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/yuv4mpeg.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- yuv4mpeg.c 17 Dec 2005 18:14:37 -0000 1.27
+++ yuv4mpeg.c 22 Dec 2005 01:10:11 -0000 1.28
@@ -96,12 +96,12 @@
/* for the first packet we have to output the header as well */
if (*first_pkt) {
*first_pkt = 0;
- if (yuv4_generate_header(s, buf2) < 0) {
- av_log(s, AV_LOG_ERROR, "Error. YUV4MPEG stream header write failed.\n");
- return AVERROR_IO;
- } else {
- put_buffer(pb, buf2, strlen(buf2));
- }
+ if (yuv4_generate_header(s, buf2) < 0) {
+ av_log(s, AV_LOG_ERROR, "Error. YUV4MPEG stream header write failed.\n");
+ return AVERROR_IO;
+ } else {
+ put_buffer(pb, buf2, strlen(buf2));
+ }
}
/* construct frame header */
@@ -126,11 +126,11 @@
ptr1 = picture->data[1];
ptr2 = picture->data[2];
- for(i=0;i<height;i++) { /* Cb */
+ for(i=0;i<height;i++) { /* Cb */
put_buffer(pb, ptr1, width);
ptr1 += picture->linesize[1];
}
- for(i=0;i<height;i++) { /* Cr */
+ for(i=0;i<height;i++) { /* Cr */
put_buffer(pb, ptr2, width);
ptr2 += picture->linesize[2];
}
@@ -154,7 +154,7 @@
(s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
(s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {
av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, yuv422p, yuv420p, yuv411p and gray pixel formats. Use -pix_fmt to select one.\n");
- return AVERROR_IO;
+ return AVERROR_IO;
}
*first_pkt = 1;
@@ -197,11 +197,11 @@
for (i=0; i<MAX_YUV4_HEADER; i++) {
header[i] = get_byte(pb);
- if (header[i] == '\n') {
- header[i+1] = 0x20; // Add a space after last option. Makes parsing "444" vs "444alpha" easier.
- header[i+2] = 0;
- break;
- }
+ if (header[i] == '\n') {
+ header[i+1] = 0x20; // Add a space after last option. Makes parsing "444" vs "444alpha" easier.
+ header[i+2] = 0;
+ break;
+ }
}
if (i == MAX_YUV4_HEADER) return -1;
if (strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC))) return -1;
@@ -341,10 +341,10 @@
for (i=0; i<MAX_FRAME_HEADER; i++) {
header[i] = get_byte(&s->pb);
- if (header[i] == '\n') {
- header[i+1] = 0;
- break;
- }
+ if (header[i] == '\n') {
+ header[i+1] = 0;
+ break;
+ }
}
if (i == MAX_FRAME_HEADER) return -1;
if (strncmp(header, Y4M_FRAME_MAGIC, strlen(Y4M_FRAME_MAGIC))) return -1;
1
0