History

Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

Anton Khirnov committed 14 years ago

Commit 716d4131 parent 78071a1296 files · +2494 −2493Browse files

Unified · Split

296 files
  1. avconv.h +1 −1
  2. avconv_filter.c +1 −1
  3. avconv_opt.c +2 −2
  4. avplay.c +2 −2
  5. avprobe.c +2 −2
  6. cmdutils.c +4 −4
  7. cmdutils.h +1 −1
  8. doc/filters.texi +1 −1
  9. libavcodec/4xm.c +2 −2
  10. libavcodec/8bps.c +5 −5
  11. libavcodec/a64multienc.c +2 −2
  12. libavcodec/aasc.c +1 −1
  13. libavcodec/anm.c +1 −1
  14. libavcodec/ansi.c +1 −1
  15. libavcodec/api-example.c +1 −1
  16. libavcodec/asv1.c +3 −3
  17. libavcodec/aura.c +1 −1
  18. libavcodec/avcodec.h +26 −25
  19. libavcodec/avs.c +1 −1
  20. libavcodec/bethsoftvideo.c +1 −1
  21. libavcodec/bfi.c +1 −1
  22. libavcodec/bink.c +1 −1
  23. libavcodec/bmp.c +12 −12
  24. libavcodec/bmpenc.c +26 −26
  25. libavcodec/bmv.c +1 −1
  26. libavcodec/c93.c +1 −1
  27. libavcodec/cavs.c +1 −1
  28. libavcodec/cdgraphics.c +1 −1
  29. libavcodec/cdxl.c +2 −2
  30. libavcodec/cinepak.c +2 −2
  31. libavcodec/cljr.c +3 −3
  32. libavcodec/cllc.c +2 −2
  33. libavcodec/cscd.c +3 −3
  34. libavcodec/cyuv.c +1 −1
  35. libavcodec/dfa.c +1 −1
  36. libavcodec/dirac.c +3 −3
  37. libavcodec/dnxhddec.c +2 −2
  38. libavcodec/dnxhdenc.c +5 −5
  39. libavcodec/dpx.c +5 −5
  40. libavcodec/dpxenc.c +10 −10
  41. libavcodec/dsicinav.c +1 −1
  42. libavcodec/dv.c +11 −11
  43. libavcodec/dv_profile.c +10 −10
  44. libavcodec/dv_profile.h +1 −1
  45. libavcodec/dvdec.c +5 −5
  46. libavcodec/dxa.c +1 −1
  47. libavcodec/dxtory.c +1 −1
  48. libavcodec/dxva2_h264.c +1 −1
  49. libavcodec/dxva2_mpeg2.c +1 −1
  50. libavcodec/dxva2_vc1.c +2 −2
  51. libavcodec/eacmv.c +1 −1
  52. libavcodec/eamad.c +1 −1
  53. libavcodec/eatgq.c +1 −1
  54. libavcodec/eatgv.c +1 −1
  55. libavcodec/eatqi.c +1 −1
  56. libavcodec/escape124.c +1 −1
  57. libavcodec/ffv1.c +22 −22
  58. libavcodec/flashsv.c +3 −3
  59. libavcodec/flashsvenc.c +1 −1
  60. libavcodec/flicvideo.c +8 −8
  61. libavcodec/flvenc.c +1 −1
  62. libavcodec/fraps.c +3 −3
  63. libavcodec/frwu.c +1 −1
  64. libavcodec/gif.c +3 −3
  65. libavcodec/gifdec.c +1 −1
  66. libavcodec/h261dec.c +1 −1
  67. libavcodec/h261enc.c +1 −1
  68. libavcodec/h263dec.c +1 −1
  69. libavcodec/h264.c +21 −21
  70. libavcodec/huffyuv.c +16 −16
  71. libavcodec/idcinvideo.c +1 −1
  72. libavcodec/iff.c +10 −10
  73. libavcodec/imgconvert.c +116 −116
  74. libavcodec/indeo2.c +1 −1
  75. libavcodec/indeo3.c +1 −1
  76. libavcodec/indeo4.c +1 −1
  77. libavcodec/indeo5.c +1 −1
  78. libavcodec/internal.h +3 −3
  79. libavcodec/interplayvideo.c +1 −1
  80. libavcodec/jpeglsenc.c +11 −11
  81. libavcodec/jvdec.c +1 −1
  82. libavcodec/kgv1dec.c +1 −1
  83. libavcodec/kmvc.c +1 −1
  84. libavcodec/lagarith.c +7 −7
  85. libavcodec/lcldec.c +6 −6
  86. libavcodec/lclenc.c +2 −2
  87. libavcodec/libopenjpegdec.c +31 −31
  88. libavcodec/libopenjpegenc.c +54 −54
  89. libavcodec/libschroedinger.h +4 −4
  90. libavcodec/libschroedingerdec.c +2 −2
  91. libavcodec/libschroedingerenc.c +2 −2
  92. libavcodec/libtheoraenc.c +5 −5
  93. libavcodec/libvpxdec.c +1 −1
  94. libavcodec/libvpxenc.c +1 −1
  95. libavcodec/libx264.c +26 −26
  96. libavcodec/libxavs.c +1 −1
  97. libavcodec/libxvid.c +2 −2
  98. libavcodec/ljpegenc.c +2 −2
  99. libavcodec/loco.c +4 −4
  100. libavcodec/mdec.c +1 −1
  101. libavcodec/mimic.c +1 −1
  102. libavcodec/mjpegdec.c +9 −9
  103. libavcodec/mjpegenc.c +6 −6
  104. libavcodec/mmvideo.c +1 −1
  105. libavcodec/motionpixels.c +1 −1
  106. libavcodec/mpeg12.c +12 −12
  107. libavcodec/mpeg12enc.c +4 −4
  108. libavcodec/mpeg4videodec.c +2 −2
  109. libavcodec/mpeg4videoenc.c +1 −1
  110. libavcodec/mpegvideo.c +11 −11
  111. libavcodec/mpegvideo.h +2 −2
  112. libavcodec/mpegvideo_enc.c +25 −25
  113. libavcodec/msrle.c +2 −2
  114. libavcodec/mss1.c +1 −1
  115. libavcodec/mss2.c +6 −6
  116. libavcodec/mss3.c +1 −1
  117. libavcodec/mss4.c +1 −1
  118. libavcodec/msvideo1.c +3 −3
  119. libavcodec/nuv.c +3 −3
  120. libavcodec/options.c +1 −1
  121. libavcodec/pamenc.c +8 −8
  122. libavcodec/pcx.c +2 −2
  123. libavcodec/pcxenc.c +14 −14
  124. libavcodec/pgssubdec.c +1 −1
  125. libavcodec/pictordec.c +1 −1
  126. libavcodec/pngdec.c +8 −8
  127. libavcodec/pngenc.c +9 −9
  128. libavcodec/pnm.c +17 −17
  129. libavcodec/pnmdec.c +9 −9
  130. libavcodec/pnmenc.c +16 −16
  131. libavcodec/proresdec.c +2 −2
  132. libavcodec/proresenc.c +4 −4
  133. libavcodec/ptx.c +1 −1
  134. libavcodec/qdrw.c +1 −1
  135. libavcodec/qpeg.c +1 −1
  136. libavcodec/qtrle.c +5 −5
  137. libavcodec/qtrleenc.c +5 −5
  138. libavcodec/r210dec.c +1 −1
  139. libavcodec/raw.c +108 −108
  140. libavcodec/raw.h +1 −1
  141. libavcodec/rawdec.c +26 −26
  142. libavcodec/rawenc.c +1 −1
  143. libavcodec/rl2.c +1 −1
  144. libavcodec/roqvideodec.c +1 −1
  145. libavcodec/roqvideoenc.c +2 −2
  146. libavcodec/rpza.c +1 −1
  147. libavcodec/rv10.c +1 −1
  148. libavcodec/rv10enc.c +1 −1
  149. libavcodec/rv20enc.c +1 −1
  150. libavcodec/rv34.c +1 −1
  151. libavcodec/sgidec.c +3 −3
  152. libavcodec/sgienc.c +5 −5
  153. libavcodec/smacker.c +1 −1
  154. libavcodec/smc.c +1 −1
  155. libavcodec/snowdec.c +1 −1
  156. libavcodec/snowenc.c +7 −7
  157. libavcodec/sunrast.c +3 −3
  158. libavcodec/sunrastenc.c +9 −9
  159. libavcodec/svq1dec.c +2 −2
  160. libavcodec/svq1enc.c +2 −2
  161. libavcodec/svq3.c +1 −1
  162. libavcodec/targa.c +6 −6
  163. libavcodec/targaenc.c +8 −8
  164. libavcodec/tiertexseqv.c +1 −1
  165. libavcodec/tiff.c +7 −7
  166. libavcodec/tiffenc.c +20 −20
  167. libavcodec/tmv.c +1 −1
  168. libavcodec/truemotion1.c +5 −5
  169. libavcodec/truemotion2.c +1 −1
  170. libavcodec/tscc.c +5 −5
  171. libavcodec/tscc2.c +1 −1
  172. libavcodec/txd.c +2 −2
  173. libavcodec/ulti.c +1 −1
  174. libavcodec/utils.c +45 −45
  175. libavcodec/utvideodec.c +9 −9
  176. libavcodec/utvideoenc.c +12 −12
  177. libavcodec/v210dec.c +1 −1
  178. libavcodec/v210enc.c +1 −1
  179. libavcodec/v210x.c +1 −1
  180. libavcodec/v410dec.c +1 −1
  181. libavcodec/v410enc.c +1 −1
  182. libavcodec/vaapi_h264.c +1 −1
  183. libavcodec/vaapi_mpeg2.c +1 −1
  184. libavcodec/vaapi_mpeg4.c +2 −2
  185. libavcodec/vaapi_vc1.c +2 −2
  186. libavcodec/vb.c +1 −1
  187. libavcodec/vble.c +1 −1
  188. libavcodec/vc1dec.c +5 −5
  189. libavcodec/vcr1.c +1 −1
  190. libavcodec/vda_h264.c +1 −1
  191. libavcodec/vmdav.c +1 −1
  192. libavcodec/vmnc.c +3 −3
  193. libavcodec/vp3.c +4 −4
  194. libavcodec/vp56.c +1 −1
  195. libavcodec/vp8.c +1 −1
  196. libavcodec/vqavideo.c +1 −1
  197. libavcodec/wmv2enc.c +1 −1
  198. libavcodec/wnv1.c +1 −1
  199. libavcodec/xan.c +1 −1
  200. libavcodec/xbmenc.c +2 −2
  201. libavcodec/xl.c +1 −1
  202. libavcodec/xsubdec.c +1 −1
  203. libavcodec/xwddec.c +13 −13
  204. libavcodec/xwdenc.c +51 −51
  205. libavcodec/xxan.c +1 −1
  206. libavcodec/yop.c +1 −1
  207. libavcodec/zerocodec.c +1 −1
  208. libavcodec/zmbv.c +1 −1
  209. libavcodec/zmbvenc.c +1 −1
  210. libavdevice/bktr.c +1 −1
  211. libavdevice/fbdev.c +11 −11
  212. libavdevice/libdc1394.c +6 −6
  213. libavdevice/v4l2.c +25 −25
  214. libavdevice/vfwcap.c +12 −12
  215. libavdevice/x11grab.c +7 −7
  216. libavfilter/avfilter.c +1 −1
  217. libavfilter/avfilter.h +1 −1
  218. libavfilter/buffersrc.c +3 −3
  219. libavfilter/drawutils.c +7 −7
  220. libavfilter/drawutils.h +1 −1
  221. libavfilter/formats.c +2 −2
  222. libavfilter/vf_blackframe.c +4 −4
  223. libavfilter/vf_boxblur.c +7 −7
  224. libavfilter/vf_crop.c +24 −24
  225. libavfilter/vf_cropdetect.c +7 −7
  226. libavfilter/vf_delogo.c +5 −5
  227. libavfilter/vf_drawbox.c +6 −6
  228. libavfilter/vf_drawtext.c +8 −8
  229. libavfilter/vf_fade.c +7 −7
  230. libavfilter/vf_fieldorder.c +2 −2
  231. libavfilter/vf_format.c +9 −9
  232. libavfilter/vf_frei0r.c +4 −4
  233. libavfilter/vf_gradfun.c +6 −6
  234. libavfilter/vf_hflip.c +24 −24
  235. libavfilter/vf_hqdn3d.c +21 −21
  236. libavfilter/vf_libopencv.c +7 −7
  237. libavfilter/vf_lut.c +25 −25
  238. libavfilter/vf_overlay.c +5 −5
  239. libavfilter/vf_pad.c +13 −13
  240. libavfilter/vf_scale.c +3 −3
  241. libavfilter/vf_transpose.c +22 −22
  242. libavfilter/vf_unsharp.c +4 −4
  243. libavfilter/vf_yadif.c +21 −21
  244. libavfilter/video.c +1 −1
  245. libavfilter/vsrc_color.c +13 −13
  246. libavfilter/vsrc_movie.c +1 −1
  247. libavfilter/vsrc_testsrc.c +28 −28
  248. libavformat/bfi.c +1 −1
  249. libavformat/bmv.c +1 −1
  250. libavformat/dvenc.c +1 −1
  251. libavformat/filmstripdec.c +1 −1
  252. libavformat/filmstripenc.c +2 −2
  253. libavformat/gif.c +3 −3
  254. libavformat/gxfenc.c +3 −3
  255. libavformat/img2dec.c +3 −3
  256. libavformat/lxfdec.c +1 −1
  257. libavformat/movenc.c +18 −18
  258. libavformat/mtv.c +1 −1
  259. libavformat/mxf.c +18 −18
  260. libavformat/mxf.h +1 −1
  261. libavformat/mxfdec.c +5 −5
  262. libavformat/output-example.c +6 −6
  263. libavformat/rawdec.c +2 −2
  264. libavformat/rtpdec_xiph.c +3 −3
  265. libavformat/rtpenc_jpeg.c +3 −3
  266. libavformat/sdp.c +3 −3
  267. libavformat/segafilm.c +1 −1
  268. libavformat/siff.c +1 −1
  269. libavformat/smacker.c +1 −1
  270. libavformat/tmv.c +1 −1
  271. libavformat/utils.c +1 −1
  272. libavformat/yuv4mpeg.c +29 −29
  273. libavutil/imgutils.c +13 −13
  274. libavutil/imgutils.h +6 −6
  275. libavutil/pixdesc.c +100 −100
  276. libavutil/pixdesc.h +3 −3
  277. libswscale/bfin/swscale_bfin.c +2 −2
  278. libswscale/bfin/yuv2rgb_bfin.c +6 −6
  279. libswscale/input.c +177 −177
  280. libswscale/options.c +2 −2
  281. libswscale/output.c +117 −117
  282. libswscale/ppc/swscale_altivec.c +8 −8
  283. libswscale/ppc/yuv2rgb_altivec.c +32 −32
  284. libswscale/ppc/yuv2yuv_altivec.c +4 −4
  285. libswscale/sparc/yuv2rgb_vis.c +2 −2
  286. libswscale/swscale-test.c +39 −39
  287. libswscale/swscale.c +3 −3
  288. libswscale/swscale.h +6 −6
  289. libswscale/swscale_internal.h +41 −41
  290. libswscale/swscale_unscaled.c +91 −91
  291. libswscale/utils.c +111 −111
  292. libswscale/x86/swscale.c +16 −16
  293. libswscale/x86/swscale_template.c +17 −17
  294. libswscale/x86/yuv2rgb.c +12 −12
  295. libswscale/x86/yuv2rgb_template.c +1 −1
  296. libswscale/yuv2rgb.c +47 −47
avconv.h+1−1
@@ -299,7 +299,7 @@ typedef struct OutputStream { · 298 unmodified lines
299 const char *attachment_filename;299 const char *attachment_filename;
300 int copy_initial_nonkeyframes;300 int copy_initial_nonkeyframes;
301 301
302 enum PixelFormat pix_fmts[2];302 enum AVPixelFormat pix_fmts[2];
303} OutputStream;303} OutputStream;
304 304
305typedef struct OutputFile {305typedef struct OutputFile {
avconv_filter.c+1−1
@@ -59,7 +59,7 @@ static char *choose_ ## var ## s(OutputStream *ost) \ · 58 unmodified lines
59 return NULL; \59 return NULL; \
60}60}
61 61
62DEF_CHOOSE_FORMAT(enum PixelFormat, pix_fmt, pix_fmts, PIX_FMT_NONE,62DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE,
63 GET_PIX_FMT_NAME, ":")63 GET_PIX_FMT_NAME, ":")
64 64
65DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,65DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
avconv_opt.c+2−2
@@ -846,7 +846,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e · 845 unmodified lines
846 846
847 av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags);847 av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags);
848 848
849 ost->pix_fmts[0] = ost->pix_fmts[1] = PIX_FMT_NONE;849 ost->pix_fmts[0] = ost->pix_fmts[1] = AV_PIX_FMT_NONE;
850 850
851 return ost;851 return ost;
852}852}
@@ -904,7 +904,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc) · 51 unmodified lines
904 ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio);904 ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio);
905 905
906 MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st);906 MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st);
907 if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == PIX_FMT_NONE) {907 if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == AV_PIX_FMT_NONE) {
908 av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt);908 av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt);
909 exit(1);909 exit(1);
910 }910 }
avplay.c+2−2
@@ -106,7 +106,7 @@ typedef struct VideoPicture { · 105 unmodified lines
106 int width, height; /* source height & width */106 int width, height; /* source height & width */
107 int allocated;107 int allocated;
108 int reallocate;108 int reallocate;
109 enum PixelFormat pix_fmt;109 enum AVPixelFormat pix_fmt;
110 110
111#if CONFIG_AVFILTER111#if CONFIG_AVFILTER
112 AVFilterBufferRef *picref;112 AVFilterBufferRef *picref;
@@ -1316,7 +1316,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t · 1203 unmodified lines
1316#if CONFIG_AVFILTER1316#if CONFIG_AVFILTER
1317 AVPicture pict_src;1317 AVPicture pict_src;
1318#else1318#else
1319 int dst_pix_fmt = PIX_FMT_YUV420P;1319 int dst_pix_fmt = AV_PIX_FMT_YUV420P;
1320#endif1320#endif
1321 /* wait until we have space to put a new picture */1321 /* wait until we have space to put a new picture */
1322 SDL_LockMutex(is->pictq_mutex);1322 SDL_LockMutex(is->pictq_mutex);
avprobe.c+2−2
@@ -630,8 +630,8 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) · 629 unmodified lines
630 &display_aspect_ratio));630 &display_aspect_ratio));
631 }631 }
632 probe_str("pix_fmt",632 probe_str("pix_fmt",
633 dec_ctx->pix_fmt != PIX_FMT_NONE ? av_pix_fmt_descriptors[dec_ctx->pix_fmt].name633 dec_ctx->pix_fmt != AV_PIX_FMT_NONE ?
634 : "unknown");634 av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
635 probe_int("level", dec_ctx->level);635 probe_int("level", dec_ctx->level);
636 break;636 break;
637 637
cmdutils.c+4−4
@@ -686,8 +686,8 @@ static void print_codec(const AVCodec *c) · 685 unmodified lines
686 }686 }
687 printf("\n");687 printf("\n");
688 }688 }
689 PRINT_CODEC_SUPPORTED(c, pix_fmts, enum PixelFormat, "pixel formats",689 PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats",
690 PIX_FMT_NONE, GET_PIX_FMT_NAME);690 AV_PIX_FMT_NONE, GET_PIX_FMT_NAME);
691 PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0,691 PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0,
692 GET_SAMPLE_RATE_NAME);692 GET_SAMPLE_RATE_NAME);
693 PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats",693 PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats",
@@ -866,7 +866,7 @@ int show_filters(void *optctx, const char *opt, const char *arg) · 172 unmodified lines
866 866
867int show_pix_fmts(void *optctx, const char *opt, const char *arg)867int show_pix_fmts(void *optctx, const char *opt, const char *arg)
868{868{
869 enum PixelFormat pix_fmt;869 enum AVPixelFormat pix_fmt;
870 870
871 printf("Pixel formats:\n"871 printf("Pixel formats:\n"
872 "I.... = Supported Input format for conversion\n"872 "I.... = Supported Input format for conversion\n"
@@ -882,7 +882,7 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg) · 9 unmodified lines
882# define sws_isSupportedOutput(x) 0882# define sws_isSupportedOutput(x) 0
883#endif883#endif
884 884
885 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) {885 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) {
886 const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];886 const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
887 printf("%c%c%c%c%c %-16s %d %2d\n",887 printf("%c%c%c%c%c %-16s %d %2d\n",
888 sws_isSupportedInput (pix_fmt) ? 'I' : '.',888 sws_isSupportedInput (pix_fmt) ? 'I' : '.',
cmdutils.h+1−1
@@ -416,7 +416,7 @@ typedef struct FrameBuffer { · 415 unmodified lines
416 int linesize[4];416 int linesize[4];
417 417
418 int h, w;418 int h, w;
419 enum PixelFormat pix_fmt;419 enum AVPixelFormat pix_fmt;
420 420
421 int refcount;421 int refcount;
422 struct FrameBuffer **pool; ///< head of the buffer pool422 struct FrameBuffer **pool; ///< head of the buffer pool
doc/filters.texi+1−1
@@ -2132,7 +2132,7 @@ will instruct the source to accept video frames with size 320x240 and · 2131 unmodified lines
2132with format "yuv410p", assuming 1/24 as the timestamps timebase and2132with format "yuv410p", assuming 1/24 as the timestamps timebase and
2133square pixels (1:1 sample aspect ratio).2133square pixels (1:1 sample aspect ratio).
2134Since the pixel format with name "yuv410p" corresponds to the number 62134Since the pixel format with name "yuv410p" corresponds to the number 6
2135(check the enum PixelFormat definition in @file{libavutil/pixfmt.h}),2135(check the enum AVPixelFormat definition in @file{libavutil/pixfmt.h}),
2136this example corresponds to:2136this example corresponds to:
2137@example2137@example
2138buffer=320:240:6:1:242138buffer=320:240:6:1:24
libavcodec/4xm.c+2−2
@@ -900,9 +900,9 @@ static av_cold int decode_init(AVCodecContext *avctx) · 899 unmodified lines
900 init_vlcs(f);900 init_vlcs(f);
901 901
902 if (f->version > 2)902 if (f->version > 2)
903 avctx->pix_fmt = PIX_FMT_RGB565;903 avctx->pix_fmt = AV_PIX_FMT_RGB565;
904 else904 else
905 avctx->pix_fmt = PIX_FMT_BGR555;905 avctx->pix_fmt = AV_PIX_FMT_BGR555;
906 906
907 return 0;907 return 0;
908}908}
libavcodec/8bps.c+5−5
@@ -40,8 +40,8 @@ · 39 unmodified lines
40#include "avcodec.h"40#include "avcodec.h"
41 41
42 42
43static const enum PixelFormat pixfmt_rgb24[] = {43static const enum AVPixelFormat pixfmt_rgb24[] = {
44 PIX_FMT_BGR24, PIX_FMT_RGB32, PIX_FMT_NONE };44 AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE };
45 45
46/*46/*
47 * Decoder context47 * Decoder context
@@ -95,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, · 47 unmodified lines
95 if (planes == 4)95 if (planes == 4)
96 planes--;96 planes--;
97 97
98 px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);98 px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_RGB32);
99 99
100 for (p = 0; p < planes; p++) {100 for (p = 0; p < planes; p++) {
101 /* Lines length pointer for this plane */101 /* Lines length pointer for this plane */
@@ -170,7 +170,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 68 unmodified lines
170 170
171 switch (avctx->bits_per_coded_sample) {171 switch (avctx->bits_per_coded_sample) {
172 case 8:172 case 8:
173 avctx->pix_fmt = PIX_FMT_PAL8;173 avctx->pix_fmt = AV_PIX_FMT_PAL8;
174 c->planes = 1;174 c->planes = 1;
175 c->planemap[0] = 0; // 1st plane is palette indexes175 c->planemap[0] = 0; // 1st plane is palette indexes
176 break;176 break;
@@ -182,7 +182,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 5 unmodified lines
182 c->planemap[2] = 0; // 3rd plane is blue182 c->planemap[2] = 0; // 3rd plane is blue
183 break;183 break;
184 case 32:184 case 32:
185 avctx->pix_fmt = PIX_FMT_RGB32;185 avctx->pix_fmt = AV_PIX_FMT_RGB32;
186 c->planes = 4;186 c->planes = 4;
187#if HAVE_BIGENDIAN187#if HAVE_BIGENDIAN
188 c->planemap[0] = 1; // 1st plane is red188 c->planemap[0] = 1; // 1st plane is red
libavcodec/a64multienc.c+2−2
@@ -379,7 +379,7 @@ AVCodec ff_a64multi_encoder = { · 378 unmodified lines
379 .init = a64multi_init_encoder,379 .init = a64multi_init_encoder,
380 .encode2 = a64multi_encode_frame,380 .encode2 = a64multi_encode_frame,
381 .close = a64multi_close_encoder,381 .close = a64multi_close_encoder,
382 .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_NONE},382 .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
383 .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),383 .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
384 .capabilities = CODEC_CAP_DELAY,384 .capabilities = CODEC_CAP_DELAY,
385};385};
@@ -392,7 +392,7 @@ AVCodec ff_a64multi5_encoder = { · 6 unmodified lines
392 .init = a64multi_init_encoder,392 .init = a64multi_init_encoder,
393 .encode2 = a64multi_encode_frame,393 .encode2 = a64multi_encode_frame,
394 .close = a64multi_close_encoder,394 .close = a64multi_close_encoder,
395 .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_NONE},395 .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE},
396 .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),396 .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
397 .capabilities = CODEC_CAP_DELAY,397 .capabilities = CODEC_CAP_DELAY,
398};398};
libavcodec/aasc.c+1−1
@@ -44,7 +44,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx) · 43 unmodified lines
44 44
45 s->avctx = avctx;45 s->avctx = avctx;
46 46
47 avctx->pix_fmt = PIX_FMT_BGR24;47 avctx->pix_fmt = AV_PIX_FMT_BGR24;
48 48
49 return 0;49 return 0;
50}50}
libavcodec/anm.c+1−1
@@ -39,7 +39,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 38 unmodified lines
39 AnmContext *s = avctx->priv_data;39 AnmContext *s = avctx->priv_data;
40 int i;40 int i;
41 41
42 avctx->pix_fmt = PIX_FMT_PAL8;42 avctx->pix_fmt = AV_PIX_FMT_PAL8;
43 43
44 s->frame.reference = 1;44 s->frame.reference = 1;
45 bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);45 bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
libavcodec/ansi.c+1−1
@@ -74,7 +74,7 @@ typedef struct { · 73 unmodified lines
74static av_cold int decode_init(AVCodecContext *avctx)74static av_cold int decode_init(AVCodecContext *avctx)
75{75{
76 AnsiContext *s = avctx->priv_data;76 AnsiContext *s = avctx->priv_data;
77 avctx->pix_fmt = PIX_FMT_PAL8;77 avctx->pix_fmt = AV_PIX_FMT_PAL8;
78 78
79 /* defaults */79 /* defaults */
80 s->font = ff_vga16_font;80 s->font = ff_vga16_font;
libavcodec/api-example.c+1−1
@@ -345,7 +345,7 @@ static void video_encode_example(const char *filename) · 344 unmodified lines
345 c->time_base= (AVRational){1,25};345 c->time_base= (AVRational){1,25};
346 c->gop_size = 10; /* emit one intra frame every ten frames */346 c->gop_size = 10; /* emit one intra frame every ten frames */
347 c->max_b_frames=1;347 c->max_b_frames=1;
348 c->pix_fmt = PIX_FMT_YUV420P;348 c->pix_fmt = AV_PIX_FMT_YUV420P;
349 349
350 /* open it */350 /* open it */
351 if (avcodec_open2(c, codec, NULL) < 0) {351 if (avcodec_open2(c, codec, NULL) < 0) {
libavcodec/asv1.c+3−3
@@ -553,7 +553,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ · 552 unmodified lines
553 common_init(avctx);553 common_init(avctx);
554 init_vlcs(a);554 init_vlcs(a);
555 ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);555 ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab);
556 avctx->pix_fmt= PIX_FMT_YUV420P;556 avctx->pix_fmt= AV_PIX_FMT_YUV420P;
557 557
558 a->inv_qscale= avctx->extradata[0];558 a->inv_qscale= avctx->extradata[0];
559 if(a->inv_qscale == 0){559 if(a->inv_qscale == 0){
@@ -649,7 +649,7 @@ AVCodec ff_asv1_encoder = { · 89 unmodified lines
649 .priv_data_size = sizeof(ASV1Context),649 .priv_data_size = sizeof(ASV1Context),
650 .init = encode_init,650 .init = encode_init,
651 .encode2 = encode_frame,651 .encode2 = encode_frame,
652 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },652 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
653 .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),653 .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
654};654};
655#endif655#endif
@@ -662,7 +662,7 @@ AVCodec ff_asv2_encoder = { · 6 unmodified lines
662 .priv_data_size = sizeof(ASV1Context),662 .priv_data_size = sizeof(ASV1Context),
663 .init = encode_init,663 .init = encode_init,
664 .encode2 = encode_frame,664 .encode2 = encode_frame,
665 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },665 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
666 .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),666 .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
667};667};
668#endif668#endif
libavcodec/aura.c+1−1
@@ -39,7 +39,7 @@ static av_cold int aura_decode_init(AVCodecContext *avctx) · 38 unmodified lines
39 /* width needs to be divisible by 4 for this codec to work */39 /* width needs to be divisible by 4 for this codec to work */
40 if (avctx->width & 0x3)40 if (avctx->width & 0x3)
41 return -1;41 return -1;
42 avctx->pix_fmt = PIX_FMT_YUV422P;42 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
43 43
44 return 0;44 return 0;
45}45}
libavcodec/avcodec.h+26−25
@@ -1011,7 +1011,7 @@ typedef struct AVFrame { · 1010 unmodified lines
1011 1011
1012 /**1012 /**
1013 * format of the frame, -1 if unknown or unset1013 * format of the frame, -1 if unknown or unset
1014 * Values correspond to enum PixelFormat for video frames,1014 * Values correspond to enum AVPixelFormat for video frames,
1015 * enum AVSampleFormat for audio)1015 * enum AVSampleFormat for audio)
1016 * - encoding: unused1016 * - encoding: unused
1017 * - decoding: Read by user.1017 * - decoding: Read by user.
@@ -1492,13 +1492,13 @@ typedef struct AVCodecContext { · 474 unmodified lines
1492 int gop_size;1492 int gop_size;
1493 1493
1494 /**1494 /**
1495 * Pixel format, see PIX_FMT_xxx.1495 * Pixel format, see AV_PIX_FMT_xxx.
1496 * May be set by the demuxer if known from headers.1496 * May be set by the demuxer if known from headers.
1497 * May be overriden by the decoder if it knows better.1497 * May be overriden by the decoder if it knows better.
1498 * - encoding: Set by user.1498 * - encoding: Set by user.
1499 * - decoding: Set by user if known, overridden by libavcodec if known1499 * - decoding: Set by user if known, overridden by libavcodec if known
1500 */1500 */
1501 enum PixelFormat pix_fmt;1501 enum AVPixelFormat pix_fmt;
1502 1502
1503 /**1503 /**
1504 * Motion estimation algorithm used for video coding.1504 * Motion estimation algorithm used for video coding.
@@ -1545,7 +1545,7 @@ typedef struct AVCodecContext { · 40 unmodified lines
1545 * - encoding: unused1545 * - encoding: unused
1546 * - decoding: Set by user, if not set the native format will be chosen.1546 * - decoding: Set by user, if not set the native format will be chosen.
1547 */1547 */
1548 enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);1548 enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
1549 1549
1550 /**1550 /**
1551 * maximum number of B-frames between non-B-frames1551 * maximum number of B-frames between non-B-frames
@@ -2931,7 +2931,7 @@ typedef struct AVCodec { · 1379 unmodified lines
2931 */2931 */
2932 int capabilities;2932 int capabilities;
2933 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}2933 const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
2934 const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -12934 const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
2935 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 02935 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
2936 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -12936 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
2937 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 02937 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
@@ -3032,7 +3032,7 @@ typedef struct AVHWAccel { · 94 unmodified lines
3032 *3032 *
3033 * Only hardware accelerated formats are supported here.3033 * Only hardware accelerated formats are supported here.
3034 */3034 */
3035 enum PixelFormat pix_fmt;3035 enum AVPixelFormat pix_fmt;
3036 3036
3037 /**3037 /**
3038 * Hardware accelerated codec capabilities.3038 * Hardware accelerated codec capabilities.
@@ -4135,7 +4135,7 @@ void av_resample_close(struct AVResampleContext *c); · 1096 unmodified lines
4135 * @param height the height of the picture4135 * @param height the height of the picture
4136 * @return zero if successful, a negative value if not4136 * @return zero if successful, a negative value if not
4137 */4137 */
4138int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);4138int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
4139 4139
4140/**4140/**
4141 * Free a picture previously allocated by avpicture_alloc().4141 * Free a picture previously allocated by avpicture_alloc().
@@ -4167,7 +4167,7 @@ void avpicture_free(AVPicture *picture); · 25 unmodified lines
4167 * @return size of the image data in bytes4167 * @return size of the image data in bytes
4168 */4168 */
4169int avpicture_fill(AVPicture *picture, uint8_t *ptr,4169int avpicture_fill(AVPicture *picture, uint8_t *ptr,
4170 enum PixelFormat pix_fmt, int width, int height);4170 enum AVPixelFormat pix_fmt, int width, int height);
4171 4171
4172/**4172/**
4173 * Copy pixel data from an AVPicture into a buffer.4173 * Copy pixel data from an AVPicture into a buffer.
@@ -4184,7 +4184,8 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr, · 10 unmodified lines
4184 * @param[in] dest_size The size of 'dest'.4184 * @param[in] dest_size The size of 'dest'.
4185 * @return The number of bytes written to dest, or a negative value (error code) on error.4185 * @return The number of bytes written to dest, or a negative value (error code) on error.
4186 */4186 */
4187int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,4187int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
4188 int width, int height,
4188 unsigned char *dest, int dest_size);4189 unsigned char *dest, int dest_size);
4189 4190
4190/**4191/**
@@ -4199,29 +4200,29 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, · 8 unmodified lines
4199 * @param height the height of the image4200 * @param height the height of the image
4200 * @return Image data size in bytes or -1 on error (e.g. too large dimensions).4201 * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
4201 */4202 */
4202int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);4203int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
4203 4204
4204/**4205/**
4205 * deinterlace - if not supported return -14206 * deinterlace - if not supported return -1
4206 */4207 */
4207int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,4208int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
4208 enum PixelFormat pix_fmt, int width, int height);4209 enum AVPixelFormat pix_fmt, int width, int height);
4209/**4210/**
4210 * Copy image src to dst. Wraps av_picture_data_copy() above.4211 * Copy image src to dst. Wraps av_picture_data_copy() above.
4211 */4212 */
4212void av_picture_copy(AVPicture *dst, const AVPicture *src,4213void av_picture_copy(AVPicture *dst, const AVPicture *src,
4213 enum PixelFormat pix_fmt, int width, int height);4214 enum AVPixelFormat pix_fmt, int width, int height);
4214 4215
4215/**4216/**
4216 * Crop image top and left side.4217 * Crop image top and left side.
4217 */4218 */
4218int av_picture_crop(AVPicture *dst, const AVPicture *src,4219int av_picture_crop(AVPicture *dst, const AVPicture *src,
4219 enum PixelFormat pix_fmt, int top_band, int left_band);4220 enum AVPixelFormat pix_fmt, int top_band, int left_band);
4220 4221
4221/**4222/**
4222 * Pad image.4223 * Pad image.
4223 */4224 */
4224int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,4225int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
4225 int padtop, int padbottom, int padleft, int padright, int *color);4226 int padtop, int padbottom, int padleft, int padright, int *color);
4226 4227
4227/**4228/**
@@ -4244,14 +4245,14 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, · 16 unmodified lines
4244 * @{4245 * @{
4245 */4246 */
4246 4247
4247void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);4248void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
4248 4249
4249/**4250/**
4250 * Return a value representing the fourCC code associated to the4251 * Return a value representing the fourCC code associated to the
4251 * pixel format pix_fmt, or 0 if no associated fourCC code can be4252 * pixel format pix_fmt, or 0 if no associated fourCC code can be
4252 * found.4253 * found.
4253 */4254 */
4254unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);4255unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
4255 4256
4256#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */4257#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
4257#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */4258#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
@@ -4277,7 +4278,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt); · 19 unmodified lines
4277 * @param[in] has_alpha Whether the source pixel format alpha channel is used.4278 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
4278 * @return Combination of flags informing you what kind of losses will occur.4279 * @return Combination of flags informing you what kind of losses will occur.
4279 */4280 */
4280int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,4281int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
4281 int has_alpha);4282 int has_alpha);
4282 4283
4283#if FF_API_FIND_BEST_PIX_FMT4284#if FF_API_FIND_BEST_PIX_FMT
@@ -4294,8 +4295,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 10 unmodified lines
4294 * pix_fmt_mask parameter.4295 * pix_fmt_mask parameter.
4295 *4296 *
4296 * @code4297 * @code
4297 * src_pix_fmt = PIX_FMT_YUV420P;4298 * src_pix_fmt = AV_PIX_FMT_YUV420P;
4298 * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24);4299 * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) || (1 << AV_PIX_FMT_RGB24);
4299 * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);4300 * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
4300 * @endcode4301 * @endcode
4301 *4302 *
@@ -4306,7 +4307,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 4 unmodified lines
4306 * @return The best pixel format to convert to or -1 if none was found.4307 * @return The best pixel format to convert to or -1 if none was found.
4307 */4308 */
4308attribute_deprecated4309attribute_deprecated
4309enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,4310enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
4310 int has_alpha, int *loss_ptr);4311 int has_alpha, int *loss_ptr);
4311#endif /* FF_API_FIND_BEST_PIX_FMT */4312#endif /* FF_API_FIND_BEST_PIX_FMT */
4312 4313
@@ -4321,17 +4322,17 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma · 8 unmodified lines
4321 * pix_fmt_list parameter.4322 * pix_fmt_list parameter.
4322 *4323 *
4323 *4324 *
4324 * @param[in] pix_fmt_list PIX_FMT_NONE terminated array of pixel formats to choose from4325 * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
4325 * @param[in] src_pix_fmt source pixel format4326 * @param[in] src_pix_fmt source pixel format
4326 * @param[in] has_alpha Whether the source pixel format alpha channel is used.4327 * @param[in] has_alpha Whether the source pixel format alpha channel is used.
4327 * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.4328 * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
4328 * @return The best pixel format to convert to or -1 if none was found.4329 * @return The best pixel format to convert to or -1 if none was found.
4329 */4330 */
4330enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,4331enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
4331 enum PixelFormat src_pix_fmt,4332 enum AVPixelFormat src_pix_fmt,
4332 int has_alpha, int *loss_ptr);4333 int has_alpha, int *loss_ptr);
4333 4334
4334enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);4335enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
4335 4336
4336/**4337/**
4337 * @}4338 * @}
libavcodec/avs.c+1−1
@@ -157,7 +157,7 @@ avs_decode_frame(AVCodecContext * avctx, · 156 unmodified lines
157 157
158static av_cold int avs_decode_init(AVCodecContext * avctx)158static av_cold int avs_decode_init(AVCodecContext * avctx)
159{159{
160 avctx->pix_fmt = PIX_FMT_PAL8;160 avctx->pix_fmt = AV_PIX_FMT_PAL8;
161 avcodec_set_dimensions(avctx, 318, 198);161 avcodec_set_dimensions(avctx, 318, 198);
162 return 0;162 return 0;
163}163}
libavcodec/bethsoftvideo.c+1−1
@@ -43,7 +43,7 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx) · 42 unmodified lines
43 vid->frame.reference = 1;43 vid->frame.reference = 1;
44 vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID |44 vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID |
45 FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;45 FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
46 avctx->pix_fmt = PIX_FMT_PAL8;46 avctx->pix_fmt = AV_PIX_FMT_PAL8;
47 return 0;47 return 0;
48}48}
49 49
libavcodec/bfi.c+1−1
@@ -39,7 +39,7 @@ typedef struct BFIContext { · 38 unmodified lines
39static av_cold int bfi_decode_init(AVCodecContext *avctx)39static av_cold int bfi_decode_init(AVCodecContext *avctx)
40{40{
41 BFIContext *bfi = avctx->priv_data;41 BFIContext *bfi = avctx->priv_data;
42 avctx->pix_fmt = PIX_FMT_PAL8;42 avctx->pix_fmt = AV_PIX_FMT_PAL8;
43 bfi->dst = av_mallocz(avctx->width * avctx->height);43 bfi->dst = av_mallocz(avctx->width * avctx->height);
44 return 0;44 return 0;
45}45}
libavcodec/bink.c+1−1
@@ -1296,7 +1296,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 1295 unmodified lines
1296 return 1;1296 return 1;
1297 }1297 }
1298 1298
1299 avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P;1299 avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
1300 1300
1301 avctx->idct_algo = FF_IDCT_BINK;1301 avctx->idct_algo = FF_IDCT_BINK;
1302 ff_dsputil_init(&c->dsp, avctx);1302 ff_dsputil_init(&c->dsp, avctx);
libavcodec/bmp.c+12−12
@@ -136,7 +136,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, · 135 unmodified lines
136 avctx->width = width;136 avctx->width = width;
137 avctx->height = height > 0? height: -height;137 avctx->height = height > 0? height: -height;
138 138
139 avctx->pix_fmt = PIX_FMT_NONE;139 avctx->pix_fmt = AV_PIX_FMT_NONE;
140 140
141 switch(depth){141 switch(depth){
142 case 32:142 case 32:
@@ -155,21 +155,21 @@ static int bmp_decode_frame(AVCodecContext *avctx, · 12 unmodified lines
155 rgb[2] = 0;155 rgb[2] = 0;
156 }156 }
157 157
158 avctx->pix_fmt = PIX_FMT_BGR24;158 avctx->pix_fmt = AV_PIX_FMT_BGR24;
159 break;159 break;
160 case 24:160 case 24:
161 avctx->pix_fmt = PIX_FMT_BGR24;161 avctx->pix_fmt = AV_PIX_FMT_BGR24;
162 break;162 break;
163 case 16:163 case 16:
164 if(comp == BMP_RGB)164 if(comp == BMP_RGB)
165 avctx->pix_fmt = PIX_FMT_RGB555;165 avctx->pix_fmt = AV_PIX_FMT_RGB555;
166 else if (comp == BMP_BITFIELDS) {166 else if (comp == BMP_BITFIELDS) {
167 if (rgb[0] == 0xF800 && rgb[1] == 0x07E0 && rgb[2] == 0x001F)167 if (rgb[0] == 0xF800 && rgb[1] == 0x07E0 && rgb[2] == 0x001F)
168 avctx->pix_fmt = PIX_FMT_RGB565;168 avctx->pix_fmt = AV_PIX_FMT_RGB565;
169 else if (rgb[0] == 0x7C00 && rgb[1] == 0x03E0 && rgb[2] == 0x001F)169 else if (rgb[0] == 0x7C00 && rgb[1] == 0x03E0 && rgb[2] == 0x001F)
170 avctx->pix_fmt = PIX_FMT_RGB555;170 avctx->pix_fmt = AV_PIX_FMT_RGB555;
171 else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F)171 else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F)
172 avctx->pix_fmt = PIX_FMT_RGB444;172 avctx->pix_fmt = AV_PIX_FMT_RGB444;
173 else {173 else {
174 av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]);174 av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]);
175 return AVERROR(EINVAL);175 return AVERROR(EINVAL);
@@ -178,14 +178,14 @@ static int bmp_decode_frame(AVCodecContext *avctx, · 2 unmodified lines
178 break;178 break;
179 case 8:179 case 8:
180 if(hsize - ihsize - 14 > 0)180 if(hsize - ihsize - 14 > 0)
181 avctx->pix_fmt = PIX_FMT_PAL8;181 avctx->pix_fmt = AV_PIX_FMT_PAL8;
182 else182 else
183 avctx->pix_fmt = PIX_FMT_GRAY8;183 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
184 break;184 break;
185 case 1:185 case 1:
186 case 4:186 case 4:
187 if(hsize - ihsize - 14 > 0){187 if(hsize - ihsize - 14 > 0){
188 avctx->pix_fmt = PIX_FMT_PAL8;188 avctx->pix_fmt = AV_PIX_FMT_PAL8;
189 }else{189 }else{
190 av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth);190 av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth);
191 return -1;191 return -1;
@@ -196,7 +196,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, · 4 unmodified lines
196 return -1;196 return -1;
197 }197 }
198 198
199 if(avctx->pix_fmt == PIX_FMT_NONE){199 if(avctx->pix_fmt == AV_PIX_FMT_NONE){
200 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");200 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
201 return -1;201 return -1;
202 }202 }
@@ -236,7 +236,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, · 33 unmodified lines
236 linesize = p->linesize[0];236 linesize = p->linesize[0];
237 }237 }
238 238
239 if(avctx->pix_fmt == PIX_FMT_PAL8){239 if(avctx->pix_fmt == AV_PIX_FMT_PAL8){
240 int colors = 1 << depth;240 int colors = 1 << depth;
241 241
242 memset(p->data[1], 0, 1024);242 memset(p->data[1], 0, 1024);
libavcodec/bmpenc.c+26−26
@@ -37,23 +37,23 @@ static av_cold int bmp_encode_init(AVCodecContext *avctx){ · 36 unmodified lines
37 avctx->coded_frame = &s->picture;37 avctx->coded_frame = &s->picture;
38 38
39 switch (avctx->pix_fmt) {39 switch (avctx->pix_fmt) {
40 case PIX_FMT_BGR24:40 case AV_PIX_FMT_BGR24:
41 avctx->bits_per_coded_sample = 24;41 avctx->bits_per_coded_sample = 24;
42 break;42 break;
43 case PIX_FMT_RGB555:43 case AV_PIX_FMT_RGB555:
44 case PIX_FMT_RGB565:44 case AV_PIX_FMT_RGB565:
45 case PIX_FMT_RGB444:45 case AV_PIX_FMT_RGB444:
46 avctx->bits_per_coded_sample = 16;46 avctx->bits_per_coded_sample = 16;
47 break;47 break;
48 case PIX_FMT_RGB8:48 case AV_PIX_FMT_RGB8:
49 case PIX_FMT_BGR8:49 case AV_PIX_FMT_BGR8:
50 case PIX_FMT_RGB4_BYTE:50 case AV_PIX_FMT_RGB4_BYTE:
51 case PIX_FMT_BGR4_BYTE:51 case AV_PIX_FMT_BGR4_BYTE:
52 case PIX_FMT_GRAY8:52 case AV_PIX_FMT_GRAY8:
53 case PIX_FMT_PAL8:53 case AV_PIX_FMT_PAL8:
54 avctx->bits_per_coded_sample = 8;54 avctx->bits_per_coded_sample = 8;
55 break;55 break;
56 case PIX_FMT_MONOBLACK:56 case AV_PIX_FMT_MONOBLACK:
57 avctx->bits_per_coded_sample = 1;57 avctx->bits_per_coded_sample = 1;
58 break;58 break;
59 default:59 default:
@@ -78,26 +78,26 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 18 unmodified lines
78 p->pict_type= AV_PICTURE_TYPE_I;78 p->pict_type= AV_PICTURE_TYPE_I;
79 p->key_frame= 1;79 p->key_frame= 1;
80 switch (avctx->pix_fmt) {80 switch (avctx->pix_fmt) {
81 case PIX_FMT_RGB444:81 case AV_PIX_FMT_RGB444:
82 compression = BMP_BITFIELDS;82 compression = BMP_BITFIELDS;
83 pal = rgb444_masks; // abuse pal to hold color masks83 pal = rgb444_masks; // abuse pal to hold color masks
84 pal_entries = 3;84 pal_entries = 3;
85 break;85 break;
86 case PIX_FMT_RGB565:86 case AV_PIX_FMT_RGB565:
87 compression = BMP_BITFIELDS;87 compression = BMP_BITFIELDS;
88 pal = rgb565_masks; // abuse pal to hold color masks88 pal = rgb565_masks; // abuse pal to hold color masks
89 pal_entries = 3;89 pal_entries = 3;
90 break;90 break;
91 case PIX_FMT_RGB8:91 case AV_PIX_FMT_RGB8:
92 case PIX_FMT_BGR8:92 case AV_PIX_FMT_BGR8:
93 case PIX_FMT_RGB4_BYTE:93 case AV_PIX_FMT_RGB4_BYTE:
94 case PIX_FMT_BGR4_BYTE:94 case AV_PIX_FMT_BGR4_BYTE:
95 case PIX_FMT_GRAY8:95 case AV_PIX_FMT_GRAY8:
96 ff_set_systematic_pal2((uint32_t*)p->data[1], avctx->pix_fmt);96 ff_set_systematic_pal2((uint32_t*)p->data[1], avctx->pix_fmt);
97 case PIX_FMT_PAL8:97 case AV_PIX_FMT_PAL8:
98 pal = (uint32_t *)p->data[1];98 pal = (uint32_t *)p->data[1];
99 break;99 break;
100 case PIX_FMT_MONOBLACK:100 case AV_PIX_FMT_MONOBLACK:
101 pal = monoblack_pal;101 pal = monoblack_pal;
102 break;102 break;
103 }103 }
@@ -166,12 +166,12 @@ AVCodec ff_bmp_encoder = { · 62 unmodified lines
166 .priv_data_size = sizeof(BMPContext),166 .priv_data_size = sizeof(BMPContext),
167 .init = bmp_encode_init,167 .init = bmp_encode_init,
168 .encode2 = bmp_encode_frame,168 .encode2 = bmp_encode_frame,
169 .pix_fmts = (const enum PixelFormat[]){169 .pix_fmts = (const enum AVPixelFormat[]){
170 PIX_FMT_BGR24,170 AV_PIX_FMT_BGR24,
171 PIX_FMT_RGB555, PIX_FMT_RGB444, PIX_FMT_RGB565,171 AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, AV_PIX_FMT_RGB565,
172 PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, PIX_FMT_GRAY8, PIX_FMT_PAL8,172 AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8,
173 PIX_FMT_MONOBLACK,173 AV_PIX_FMT_MONOBLACK,
174 PIX_FMT_NONE174 AV_PIX_FMT_NONE
175 },175 },
176 .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),176 .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
177};177};
libavcodec/bmv.c+1−1
@@ -266,7 +266,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 265 unmodified lines
266 BMVDecContext * const c = avctx->priv_data;266 BMVDecContext * const c = avctx->priv_data;
267 267
268 c->avctx = avctx;268 c->avctx = avctx;
269 avctx->pix_fmt = PIX_FMT_PAL8;269 avctx->pix_fmt = AV_PIX_FMT_PAL8;
270 270
271 c->pic.reference = 1;271 c->pic.reference = 1;
272 if (avctx->get_buffer(avctx, &c->pic) < 0) {272 if (avctx->get_buffer(avctx, &c->pic) < 0) {
libavcodec/c93.c+1−1
@@ -47,7 +47,7 @@ typedef enum { · 46 unmodified lines
47 47
48static av_cold int decode_init(AVCodecContext *avctx)48static av_cold int decode_init(AVCodecContext *avctx)
49{49{
50 avctx->pix_fmt = PIX_FMT_PAL8;50 avctx->pix_fmt = AV_PIX_FMT_PAL8;
51 return 0;51 return 0;
52}52}
53 53
libavcodec/cavs.c+1−1
@@ -712,7 +712,7 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) { · 711 unmodified lines
712 ff_cavsdsp_init(&h->cdsp, avctx);712 ff_cavsdsp_init(&h->cdsp, avctx);
713 s->avctx = avctx;713 s->avctx = avctx;
714 714
715 avctx->pix_fmt= PIX_FMT_YUV420P;715 avctx->pix_fmt= AV_PIX_FMT_YUV420P;
716 716
717 h->luma_scan[0] = 0;717 h->luma_scan[0] = 0;
718 h->luma_scan[1] = 8;718 h->luma_scan[1] = 8;
libavcodec/cdgraphics.c+1−1
@@ -86,7 +86,7 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) · 85 unmodified lines
86 86
87 avctx->width = CDG_FULL_WIDTH;87 avctx->width = CDG_FULL_WIDTH;
88 avctx->height = CDG_FULL_HEIGHT;88 avctx->height = CDG_FULL_HEIGHT;
89 avctx->pix_fmt = PIX_FMT_PAL8;89 avctx->pix_fmt = AV_PIX_FMT_PAL8;
90 90
91 return 0;91 return 0;
92}92}
libavcodec/cdxl.c+2−2
@@ -247,11 +247,11 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data, · 246 unmodified lines
247 if (c->video_size < aligned_width * avctx->height * c->bpp / 8)247 if (c->video_size < aligned_width * avctx->height * c->bpp / 8)
248 return AVERROR_INVALIDDATA;248 return AVERROR_INVALIDDATA;
249 if (!encoding && c->palette_size && c->bpp <= 8) {249 if (!encoding && c->palette_size && c->bpp <= 8) {
250 avctx->pix_fmt = PIX_FMT_PAL8;250 avctx->pix_fmt = AV_PIX_FMT_PAL8;
251 } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {251 } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {
252 if (c->palette_size != (1 << (c->bpp - 1)))252 if (c->palette_size != (1 << (c->bpp - 1)))
253 return AVERROR_INVALIDDATA;253 return AVERROR_INVALIDDATA;
254 avctx->pix_fmt = PIX_FMT_BGR24;254 avctx->pix_fmt = AV_PIX_FMT_BGR24;
255 } else {255 } else {
256 av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n",256 av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n",
257 encoding, c->bpp);257 encoding, c->bpp);
libavcodec/cinepak.c+2−2
@@ -407,10 +407,10 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx) · 406 unmodified lines
407 // check for paletted data407 // check for paletted data
408 if (avctx->bits_per_coded_sample != 8) {408 if (avctx->bits_per_coded_sample != 8) {
409 s->palette_video = 0;409 s->palette_video = 0;
410 avctx->pix_fmt = PIX_FMT_YUV420P;410 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
411 } else {411 } else {
412 s->palette_video = 1;412 s->palette_video = 1;
413 avctx->pix_fmt = PIX_FMT_PAL8;413 avctx->pix_fmt = AV_PIX_FMT_PAL8;
414 }414 }
415 415
416 s->frame.data[0] = NULL;416 s->frame.data[0] = NULL;
libavcodec/cljr.c+3−3
@@ -102,7 +102,7 @@ static int decode_frame(AVCodecContext *avctx, · 101 unmodified lines
102 102
103static av_cold int decode_init(AVCodecContext *avctx)103static av_cold int decode_init(AVCodecContext *avctx)
104{104{
105 avctx->pix_fmt = PIX_FMT_YUV411P;105 avctx->pix_fmt = AV_PIX_FMT_YUV411P;
106 return common_init(avctx);106 return common_init(avctx);
107}107}
108 108
@@ -175,8 +175,8 @@ AVCodec ff_cljr_encoder = { · 66 unmodified lines
175 .priv_data_size = sizeof(CLJRContext),175 .priv_data_size = sizeof(CLJRContext),
176 .init = common_init,176 .init = common_init,
177 .encode2 = encode_frame,177 .encode2 = encode_frame,
178 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV411P,178 .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
179 PIX_FMT_NONE },179 AV_PIX_FMT_NONE },
180 .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),180 .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
181};181};
182#endif182#endif
libavcodec/cllc.c+2−2
@@ -330,7 +330,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data, · 329 unmodified lines
330 switch (coding_type) {330 switch (coding_type) {
331 case 1:331 case 1:
332 case 2:332 case 2:
333 avctx->pix_fmt = PIX_FMT_RGB24;333 avctx->pix_fmt = AV_PIX_FMT_RGB24;
334 avctx->bits_per_raw_sample = 8;334 avctx->bits_per_raw_sample = 8;
335 335
336 ret = avctx->get_buffer(avctx, pic);336 ret = avctx->get_buffer(avctx, pic);
@@ -345,7 +345,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data, · 8 unmodified lines
345 345
346 break;346 break;
347 case 3:347 case 3:
348 avctx->pix_fmt = PIX_FMT_ARGB;348 avctx->pix_fmt = AV_PIX_FMT_ARGB;
349 avctx->bits_per_raw_sample = 8;349 avctx->bits_per_raw_sample = 8;
350 350
351 ret = avctx->get_buffer(avctx, pic);351 ret = avctx->get_buffer(avctx, pic);
libavcodec/cscd.c+3−3
@@ -222,9 +222,9 @@ static av_cold int decode_init(AVCodecContext *avctx) { · 221 unmodified lines
222 CamStudioContext *c = avctx->priv_data;222 CamStudioContext *c = avctx->priv_data;
223 int stride;223 int stride;
224 switch (avctx->bits_per_coded_sample) {224 switch (avctx->bits_per_coded_sample) {
225 case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;225 case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
226 case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;226 case 24: avctx->pix_fmt = AV_PIX_FMT_BGR24; break;
227 case 32: avctx->pix_fmt = PIX_FMT_RGB32; break;227 case 32: avctx->pix_fmt = AV_PIX_FMT_RGB32; break;
228 default:228 default:
229 av_log(avctx, AV_LOG_ERROR,229 av_log(avctx, AV_LOG_ERROR,
230 "CamStudio codec error: invalid depth %i bpp\n",230 "CamStudio codec error: invalid depth %i bpp\n",
libavcodec/cyuv.c+1−1
@@ -53,7 +53,7 @@ static av_cold int cyuv_decode_init(AVCodecContext *avctx) · 52 unmodified lines
53 if (s->width & 0x3)53 if (s->width & 0x3)
54 return -1;54 return -1;
55 s->height = avctx->height;55 s->height = avctx->height;
56 avctx->pix_fmt = PIX_FMT_YUV411P;56 avctx->pix_fmt = AV_PIX_FMT_YUV411P;
57 57
58 return 0;58 return 0;
59}59}
libavcodec/dfa.c+1−1
@@ -38,7 +38,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx) · 37 unmodified lines
38 DfaContext *s = avctx->priv_data;38 DfaContext *s = avctx->priv_data;
39 int ret;39 int ret;
40 40
41 avctx->pix_fmt = PIX_FMT_PAL8;41 avctx->pix_fmt = AV_PIX_FMT_PAL8;
42 42
43 if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)43 if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
44 return ret;44 return ret;
libavcodec/dirac.c+3−3
@@ -107,9 +107,9 @@ static const struct { · 106 unmodified lines
107};107};
108 108
109/* [DIRAC_STD] Table 10.2 Supported chroma sampling formats + luma Offset */109/* [DIRAC_STD] Table 10.2 Supported chroma sampling formats + luma Offset */
110static const enum PixelFormat dirac_pix_fmt[2][3] = {110static const enum AVPixelFormat dirac_pix_fmt[2][3] = {
111 { PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P },111 { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P },
112 { PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P },112 { AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P },
113};113};
114 114
115/* [DIRAC_STD] 10.3 Parse Source Parameters.115/* [DIRAC_STD] 10.3 Parse Source Parameters.
libavcodec/dnxhddec.c+2−2
@@ -124,7 +124,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si · 123 unmodified lines
124 av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);124 av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
125 125
126 if (buf[0x21] & 0x40) {126 if (buf[0x21] & 0x40) {
127 ctx->avctx->pix_fmt = PIX_FMT_YUV422P10;127 ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
128 ctx->avctx->bits_per_raw_sample = 10;128 ctx->avctx->bits_per_raw_sample = 10;
129 if (ctx->bit_depth != 10) {129 if (ctx->bit_depth != 10) {
130 ff_dsputil_init(&ctx->dsp, ctx->avctx);130 ff_dsputil_init(&ctx->dsp, ctx->avctx);
@@ -132,7 +132,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si · 1 unmodified line
132 ctx->decode_dct_block = dnxhd_decode_dct_block_10;132 ctx->decode_dct_block = dnxhd_decode_dct_block_10;
133 }133 }
134 } else {134 } else {
135 ctx->avctx->pix_fmt = PIX_FMT_YUV422P;135 ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
136 ctx->avctx->bits_per_raw_sample = 8;136 ctx->avctx->bits_per_raw_sample = 8;
137 if (ctx->bit_depth != 8) {137 if (ctx->bit_depth != 8) {
138 ff_dsputil_init(&ctx->dsp, ctx->avctx);138 ff_dsputil_init(&ctx->dsp, ctx->avctx);
libavcodec/dnxhdenc.c+5−5
@@ -233,10 +233,10 @@ static int dnxhd_encode_init(AVCodecContext *avctx) · 232 unmodified lines
233 int i, index, bit_depth;233 int i, index, bit_depth;
234 234
235 switch (avctx->pix_fmt) {235 switch (avctx->pix_fmt) {
236 case PIX_FMT_YUV422P:236 case AV_PIX_FMT_YUV422P:
237 bit_depth = 8;237 bit_depth = 8;
238 break;238 break;
239 case PIX_FMT_YUV422P10:239 case AV_PIX_FMT_YUV422P10:
240 bit_depth = 10;240 bit_depth = 10;
241 break;241 break;
242 default:242 default:
@@ -1005,9 +1005,9 @@ AVCodec ff_dnxhd_encoder = { · 762 unmodified lines
1005 .encode2 = dnxhd_encode_picture,1005 .encode2 = dnxhd_encode_picture,
1006 .close = dnxhd_encode_end,1006 .close = dnxhd_encode_end,
1007 .capabilities = CODEC_CAP_SLICE_THREADS,1007 .capabilities = CODEC_CAP_SLICE_THREADS,
1008 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV422P,1008 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P,
1009 PIX_FMT_YUV422P10,1009 AV_PIX_FMT_YUV422P10,
1010 PIX_FMT_NONE },1010 AV_PIX_FMT_NONE },
1011 .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),1011 .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
1012 .priv_class = &class,1012 .priv_class = &class,
1013};1013};
libavcodec/dpx.c+5−5
@@ -126,24 +126,24 @@ static int decode_frame(AVCodecContext *avctx, · 125 unmodified lines
126 switch (bits_per_color) {126 switch (bits_per_color) {
127 case 8:127 case 8:
128 if (elements == 4) {128 if (elements == 4) {
129 avctx->pix_fmt = PIX_FMT_RGBA;129 avctx->pix_fmt = AV_PIX_FMT_RGBA;
130 } else {130 } else {
131 avctx->pix_fmt = PIX_FMT_RGB24;131 avctx->pix_fmt = AV_PIX_FMT_RGB24;
132 }132 }
133 source_packet_size = elements;133 source_packet_size = elements;
134 target_packet_size = elements;134 target_packet_size = elements;
135 break;135 break;
136 case 10:136 case 10:
137 avctx->pix_fmt = PIX_FMT_RGB48;137 avctx->pix_fmt = AV_PIX_FMT_RGB48;
138 target_packet_size = 6;138 target_packet_size = 6;
139 source_packet_size = 4;139 source_packet_size = 4;
140 break;140 break;
141 case 12:141 case 12:
142 case 16:142 case 16:
143 if (endian) {143 if (endian) {
144 avctx->pix_fmt = PIX_FMT_RGB48BE;144 avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
145 } else {145 } else {
146 avctx->pix_fmt = PIX_FMT_RGB48LE;146 avctx->pix_fmt = AV_PIX_FMT_RGB48LE;
147 }147 }
148 target_packet_size = 6;148 target_packet_size = 6;
149 source_packet_size = elements * 2;149 source_packet_size = elements * 2;
libavcodec/dpxenc.c+10−10
@@ -45,14 +45,14 @@ static av_cold int encode_init(AVCodecContext *avctx) · 44 unmodified lines
45 s->descriptor = 50; /* RGB */45 s->descriptor = 50; /* RGB */
46 46
47 switch (avctx->pix_fmt) {47 switch (avctx->pix_fmt) {
48 case PIX_FMT_RGB24:48 case AV_PIX_FMT_RGB24:
49 break;49 break;
50 case PIX_FMT_RGBA:50 case AV_PIX_FMT_RGBA:
51 s->descriptor = 51; /* RGBA */51 s->descriptor = 51; /* RGBA */
52 break;52 break;
53 case PIX_FMT_RGB48LE:53 case AV_PIX_FMT_RGB48LE:
54 s->big_endian = 0;54 s->big_endian = 0;
55 case PIX_FMT_RGB48BE:55 case AV_PIX_FMT_RGB48BE:
56 s->bits_per_component = avctx->bits_per_raw_sample ? avctx->bits_per_raw_sample : 16;56 s->bits_per_component = avctx->bits_per_raw_sample ? avctx->bits_per_raw_sample : 16;
57 break;57 break;
58 default:58 default:
@@ -180,11 +180,11 @@ AVCodec ff_dpx_encoder = { · 121 unmodified lines
180 .priv_data_size = sizeof(DPXContext),180 .priv_data_size = sizeof(DPXContext),
181 .init = encode_init,181 .init = encode_init,
182 .encode2 = encode_frame,182 .encode2 = encode_frame,
183 .pix_fmts = (const enum PixelFormat[]){183 .pix_fmts = (const enum AVPixelFormat[]){
184 PIX_FMT_RGB24,184 AV_PIX_FMT_RGB24,
185 PIX_FMT_RGBA,185 AV_PIX_FMT_RGBA,
186 PIX_FMT_RGB48LE,186 AV_PIX_FMT_RGB48LE,
187 PIX_FMT_RGB48BE,187 AV_PIX_FMT_RGB48BE,
188 PIX_FMT_NONE},188 AV_PIX_FMT_NONE},
189 .long_name = NULL_IF_CONFIG_SMALL("DPX image"),189 .long_name = NULL_IF_CONFIG_SMALL("DPX image"),
190};190};
libavcodec/dsicinav.c+1−1
@@ -93,7 +93,7 @@ static av_cold int cinvideo_decode_init(AVCodecContext *avctx) · 92 unmodified lines
93 unsigned int i;93 unsigned int i;
94 94
95 cin->avctx = avctx;95 cin->avctx = avctx;
96 avctx->pix_fmt = PIX_FMT_PAL8;96 avctx->pix_fmt = AV_PIX_FMT_PAL8;
97 97
98 cin->frame.data[0] = NULL;98 cin->frame.data[0] = NULL;
99 99
libavcodec/dv.c+11−11
@@ -137,19 +137,19 @@ static inline void dv_calc_mb_coordinates(const DVprofile *d, int chan, int seq, · 136 unmodified lines
137 break;137 break;
138 case 720:138 case 720:
139 switch (d->pix_fmt) {139 switch (d->pix_fmt) {
140 case PIX_FMT_YUV422P:140 case AV_PIX_FMT_YUV422P:
141 x = shuf3[m] + slot/3;141 x = shuf3[m] + slot/3;
142 y = serpent1[slot] +142 y = serpent1[slot] +
143 ((((seq + off[m]) % d->difseg_size)<<1) + chan)*3;143 ((((seq + off[m]) % d->difseg_size)<<1) + chan)*3;
144 tbl[m] = (x<<1)|(y<<8);144 tbl[m] = (x<<1)|(y<<8);
145 break;145 break;
146 case PIX_FMT_YUV420P:146 case AV_PIX_FMT_YUV420P:
147 x = shuf3[m] + slot/3;147 x = shuf3[m] + slot/3;
148 y = serpent1[slot] +148 y = serpent1[slot] +
149 ((seq + off[m]) % d->difseg_size)*3;149 ((seq + off[m]) % d->difseg_size)*3;
150 tbl[m] = (x<<1)|(y<<9);150 tbl[m] = (x<<1)|(y<<9);
151 break;151 break;
152 case PIX_FMT_YUV411P:152 case AV_PIX_FMT_YUV411P:
153 i = (seq + off[m]) % d->difseg_size;153 i = (seq + off[m]) % d->difseg_size;
154 k = slot + ((m==1||m==2)?3:0);154 k = slot + ((m==1||m==2)?3:0);
155 155
@@ -677,8 +677,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) · 521 unmodified lines
677 dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);677 dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
678 678
679 /* initializing luminance blocks */679 /* initializing luminance blocks */
680 if ((s->sys->pix_fmt == PIX_FMT_YUV420P) ||680 if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
681 (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||681 (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
682 (s->sys->height >= 720 && mb_y != 134)) {682 (s->sys->height >= 720 && mb_y != 134)) {
683 y_stride = s->picture.linesize[0] << 3;683 y_stride = s->picture.linesize[0] << 3;
684 } else {684 } else {
@@ -703,13 +703,13 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) · 18 unmodified lines
703 enc_blk += 4;703 enc_blk += 4;
704 704
705 /* initializing chrominance blocks */705 /* initializing chrominance blocks */
706 c_offset = (((mb_y >> (s->sys->pix_fmt == PIX_FMT_YUV420P)) * s->picture.linesize[1] +706 c_offset = (((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->picture.linesize[1] +
707 (mb_x >> ((s->sys->pix_fmt == PIX_FMT_YUV411P) ? 2 : 1))) << 3);707 (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << 3);
708 for (j = 2; j; j--) {708 for (j = 2; j; j--) {
709 uint8_t *c_ptr = s->picture.data[j] + c_offset;709 uint8_t *c_ptr = s->picture.data[j] + c_offset;
710 linesize = s->picture.linesize[j];710 linesize = s->picture.linesize[j];
711 y_stride = (mb_y == 134) ? 8 : (s->picture.linesize[j] << 3);711 y_stride = (mb_y == 134) ? 8 : (s->picture.linesize[j] << 3);
712 if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) {712 if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) {
713 uint8_t* d;713 uint8_t* d;
714 uint8_t* b = scratch;714 uint8_t* b = scratch;
715 for (i = 0; i < 8; i++) {715 for (i = 0; i < 8; i++) {
@@ -806,7 +806,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, · 90 unmodified lines
806 * 2. It is not at all clear what STYPE is used for 4:2:0 PAL806 * 2. It is not at all clear what STYPE is used for 4:2:0 PAL
807 * compression scheme (if any).807 * compression scheme (if any).
808 */808 */
809 int apt = (c->sys->pix_fmt == PIX_FMT_YUV420P ? 0 : 1);809 int apt = (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0 : 1);
810 810
811 uint8_t aspect = 0;811 uint8_t aspect = 0;
812 if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */812 if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */
@@ -984,8 +984,8 @@ AVCodec ff_dvvideo_encoder = { · 171 unmodified lines
984 .init = dvvideo_init_encoder,984 .init = dvvideo_init_encoder,
985 .encode2 = dvvideo_encode_frame,985 .encode2 = dvvideo_encode_frame,
986 .capabilities = CODEC_CAP_SLICE_THREADS,986 .capabilities = CODEC_CAP_SLICE_THREADS,
987 .pix_fmts = (const enum PixelFormat[]) {987 .pix_fmts = (const enum AVPixelFormat[]) {
988 PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE988 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
989 },989 },
990 .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),990 .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
991};991};
libavcodec/dv_profile.c+10−10
@@ -90,7 +90,7 @@ static const DVprofile dv_profiles[] = { · 89 unmodified lines
90 .sar = {{8, 9}, {32, 27}},90 .sar = {{8, 9}, {32, 27}},
91 .work_chunks = &work_chunks_dv25ntsc[0],91 .work_chunks = &work_chunks_dv25ntsc[0],
92 .idct_factor = &dv_idct_factor_sd[0],92 .idct_factor = &dv_idct_factor_sd[0],
93 .pix_fmt = PIX_FMT_YUV411P,93 .pix_fmt = AV_PIX_FMT_YUV411P,
94 .bpm = 6,94 .bpm = 6,
95 .block_sizes = block_sizes_dv2550,95 .block_sizes = block_sizes_dv2550,
96 .audio_stride = 90,96 .audio_stride = 90,
@@ -110,7 +110,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
110 .sar = {{16, 15}, {64, 45}},110 .sar = {{16, 15}, {64, 45}},
111 .work_chunks = &work_chunks_dv25pal[0],111 .work_chunks = &work_chunks_dv25pal[0],
112 .idct_factor = &dv_idct_factor_sd[0],112 .idct_factor = &dv_idct_factor_sd[0],
113 .pix_fmt = PIX_FMT_YUV420P,113 .pix_fmt = AV_PIX_FMT_YUV420P,
114 .bpm = 6,114 .bpm = 6,
115 .block_sizes = block_sizes_dv2550,115 .block_sizes = block_sizes_dv2550,
116 .audio_stride = 108,116 .audio_stride = 108,
@@ -130,7 +130,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
130 .sar = {{16, 15}, {64, 45}},130 .sar = {{16, 15}, {64, 45}},
131 .work_chunks = &work_chunks_dv25pal411[0],131 .work_chunks = &work_chunks_dv25pal411[0],
132 .idct_factor = &dv_idct_factor_sd[0],132 .idct_factor = &dv_idct_factor_sd[0],
133 .pix_fmt = PIX_FMT_YUV411P,133 .pix_fmt = AV_PIX_FMT_YUV411P,
134 .bpm = 6,134 .bpm = 6,
135 .block_sizes = block_sizes_dv2550,135 .block_sizes = block_sizes_dv2550,
136 .audio_stride = 108,136 .audio_stride = 108,
@@ -150,7 +150,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
150 .sar = {{8, 9}, {32, 27}},150 .sar = {{8, 9}, {32, 27}},
151 .work_chunks = &work_chunks_dv50ntsc[0],151 .work_chunks = &work_chunks_dv50ntsc[0],
152 .idct_factor = &dv_idct_factor_sd[0],152 .idct_factor = &dv_idct_factor_sd[0],
153 .pix_fmt = PIX_FMT_YUV422P,153 .pix_fmt = AV_PIX_FMT_YUV422P,
154 .bpm = 6,154 .bpm = 6,
155 .block_sizes = block_sizes_dv2550,155 .block_sizes = block_sizes_dv2550,
156 .audio_stride = 90,156 .audio_stride = 90,
@@ -170,7 +170,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
170 .sar = {{16, 15}, {64, 45}},170 .sar = {{16, 15}, {64, 45}},
171 .work_chunks = &work_chunks_dv50pal[0],171 .work_chunks = &work_chunks_dv50pal[0],
172 .idct_factor = &dv_idct_factor_sd[0],172 .idct_factor = &dv_idct_factor_sd[0],
173 .pix_fmt = PIX_FMT_YUV422P,173 .pix_fmt = AV_PIX_FMT_YUV422P,
174 .bpm = 6,174 .bpm = 6,
175 .block_sizes = block_sizes_dv2550,175 .block_sizes = block_sizes_dv2550,
176 .audio_stride = 108,176 .audio_stride = 108,
@@ -190,7 +190,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
190 .sar = {{1, 1}, {3, 2}},190 .sar = {{1, 1}, {3, 2}},
191 .work_chunks = &work_chunks_dv100ntsci[0],191 .work_chunks = &work_chunks_dv100ntsci[0],
192 .idct_factor = &dv_idct_factor_hd1080[0],192 .idct_factor = &dv_idct_factor_hd1080[0],
193 .pix_fmt = PIX_FMT_YUV422P,193 .pix_fmt = AV_PIX_FMT_YUV422P,
194 .bpm = 8,194 .bpm = 8,
195 .block_sizes = block_sizes_dv100,195 .block_sizes = block_sizes_dv100,
196 .audio_stride = 90,196 .audio_stride = 90,
@@ -210,7 +210,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
210 .sar = {{1, 1}, {4, 3}},210 .sar = {{1, 1}, {4, 3}},
211 .work_chunks = &work_chunks_dv100pali[0],211 .work_chunks = &work_chunks_dv100pali[0],
212 .idct_factor = &dv_idct_factor_hd1080[0],212 .idct_factor = &dv_idct_factor_hd1080[0],
213 .pix_fmt = PIX_FMT_YUV422P,213 .pix_fmt = AV_PIX_FMT_YUV422P,
214 .bpm = 8,214 .bpm = 8,
215 .block_sizes = block_sizes_dv100,215 .block_sizes = block_sizes_dv100,
216 .audio_stride = 108,216 .audio_stride = 108,
@@ -230,7 +230,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
230 .sar = {{1, 1}, {4, 3}},230 .sar = {{1, 1}, {4, 3}},
231 .work_chunks = &work_chunks_dv100ntscp[0],231 .work_chunks = &work_chunks_dv100ntscp[0],
232 .idct_factor = &dv_idct_factor_hd720[0],232 .idct_factor = &dv_idct_factor_hd720[0],
233 .pix_fmt = PIX_FMT_YUV422P,233 .pix_fmt = AV_PIX_FMT_YUV422P,
234 .bpm = 8,234 .bpm = 8,
235 .block_sizes = block_sizes_dv100,235 .block_sizes = block_sizes_dv100,
236 .audio_stride = 90,236 .audio_stride = 90,
@@ -250,7 +250,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
250 .sar = {{1, 1}, {4, 3}},250 .sar = {{1, 1}, {4, 3}},
251 .work_chunks = &work_chunks_dv100palp[0],251 .work_chunks = &work_chunks_dv100palp[0],
252 .idct_factor = &dv_idct_factor_hd720[0],252 .idct_factor = &dv_idct_factor_hd720[0],
253 .pix_fmt = PIX_FMT_YUV422P,253 .pix_fmt = AV_PIX_FMT_YUV422P,
254 .bpm = 8,254 .bpm = 8,
255 .block_sizes = block_sizes_dv100,255 .block_sizes = block_sizes_dv100,
256 .audio_stride = 90,256 .audio_stride = 90,
@@ -270,7 +270,7 @@ static const DVprofile dv_profiles[] = { · 13 unmodified lines
270 .sar = {{16, 15}, {64, 45}},270 .sar = {{16, 15}, {64, 45}},
271 .work_chunks = &work_chunks_dv25pal[0],271 .work_chunks = &work_chunks_dv25pal[0],
272 .idct_factor = &dv_idct_factor_sd[0],272 .idct_factor = &dv_idct_factor_sd[0],
273 .pix_fmt = PIX_FMT_YUV420P,273 .pix_fmt = AV_PIX_FMT_YUV420P,
274 .bpm = 6,274 .bpm = 6,
275 .block_sizes = block_sizes_dv2550,275 .block_sizes = block_sizes_dv2550,
276 .audio_stride = 108,276 .audio_stride = 108,
libavcodec/dv_profile.h+1−1
@@ -49,7 +49,7 @@ typedef struct DVprofile { · 48 unmodified lines
49 AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */49 AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
50 DVwork_chunk *work_chunks; /* each thread gets its own chunk of frame to work on */50 DVwork_chunk *work_chunks; /* each thread gets its own chunk of frame to work on */
51 uint32_t *idct_factor; /* set of iDCT factor tables */51 uint32_t *idct_factor; /* set of iDCT factor tables */
52 enum PixelFormat pix_fmt; /* picture pixel format */52 enum AVPixelFormat pix_fmt; /* picture pixel format */
53 int bpm; /* blocks per macroblock */53 int bpm; /* blocks per macroblock */
54 const uint8_t *block_sizes; /* AC block sizes, in bits */54 const uint8_t *block_sizes; /* AC block sizes, in bits */
55 int audio_stride; /* size of audio_shuffle table */55 int audio_stride; /* size of audio_shuffle table */
libavcodec/dvdec.c+5−5
@@ -253,8 +253,8 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) · 252 unmodified lines
253 dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);253 dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
254 254
255 /* idct_put'ting luminance */255 /* idct_put'ting luminance */
256 if ((s->sys->pix_fmt == PIX_FMT_YUV420P) ||256 if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
257 (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||257 (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
258 (s->sys->height >= 720 && mb_y != 134)) {258 (s->sys->height >= 720 && mb_y != 134)) {
259 y_stride = (s->picture.linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));259 y_stride = (s->picture.linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));
260 } else {260 } else {
@@ -274,11 +274,11 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) · 13 unmodified lines
274 block += 4*64;274 block += 4*64;
275 275
276 /* idct_put'ting chrominance */276 /* idct_put'ting chrominance */
277 c_offset = (((mb_y >> (s->sys->pix_fmt == PIX_FMT_YUV420P)) * s->picture.linesize[1] +277 c_offset = (((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->picture.linesize[1] +
278 (mb_x >> ((s->sys->pix_fmt == PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize);278 (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize);
279 for (j = 2; j; j--) {279 for (j = 2; j; j--) {
280 uint8_t *c_ptr = s->picture.data[j] + c_offset;280 uint8_t *c_ptr = s->picture.data[j] + c_offset;
281 if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) {281 if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) {
282 uint64_t aligned_pixels[64/8];282 uint64_t aligned_pixels[64/8];
283 uint8_t *pixels = (uint8_t*)aligned_pixels;283 uint8_t *pixels = (uint8_t*)aligned_pixels;
284 uint8_t *c_ptr1, *ptr1;284 uint8_t *c_ptr1, *ptr1;
libavcodec/dxa.c+1−1
@@ -292,7 +292,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 291 unmodified lines
292{292{
293 DxaDecContext * const c = avctx->priv_data;293 DxaDecContext * const c = avctx->priv_data;
294 294
295 avctx->pix_fmt = PIX_FMT_PAL8;295 avctx->pix_fmt = AV_PIX_FMT_PAL8;
296 296
297 c->dsize = avctx->width * avctx->height * 2;297 c->dsize = avctx->width * avctx->height * 2;
298 if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {298 if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
libavcodec/dxtory.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27static av_cold int decode_init(AVCodecContext *avctx)27static av_cold int decode_init(AVCodecContext *avctx)
28{28{
29 avctx->pix_fmt = PIX_FMT_YUV420P;29 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
30 avctx->coded_frame = avcodec_alloc_frame();30 avctx->coded_frame = avcodec_alloc_frame();
31 if (!avctx->coded_frame)31 if (!avctx->coded_frame)
32 return AVERROR(ENOMEM);32 return AVERROR(ENOMEM);
libavcodec/dxva2_h264.c+1−1
@@ -443,7 +443,7 @@ AVHWAccel ff_h264_dxva2_hwaccel = { · 442 unmodified lines
443 .name = "h264_dxva2",443 .name = "h264_dxva2",
444 .type = AVMEDIA_TYPE_VIDEO,444 .type = AVMEDIA_TYPE_VIDEO,
445 .id = AV_CODEC_ID_H264,445 .id = AV_CODEC_ID_H264,
446 .pix_fmt = PIX_FMT_DXVA2_VLD,446 .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
447 .start_frame = start_frame,447 .start_frame = start_frame,
448 .decode_slice = decode_slice,448 .decode_slice = decode_slice,
449 .end_frame = end_frame,449 .end_frame = end_frame,
libavcodec/dxva2_mpeg2.c+1−1
@@ -264,7 +264,7 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = { · 263 unmodified lines
264 .name = "mpeg2_dxva2",264 .name = "mpeg2_dxva2",
265 .type = AVMEDIA_TYPE_VIDEO,265 .type = AVMEDIA_TYPE_VIDEO,
266 .id = AV_CODEC_ID_MPEG2VIDEO,266 .id = AV_CODEC_ID_MPEG2VIDEO,
267 .pix_fmt = PIX_FMT_DXVA2_VLD,267 .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
268 .start_frame = start_frame,268 .start_frame = start_frame,
269 .decode_slice = decode_slice,269 .decode_slice = decode_slice,
270 .end_frame = end_frame,270 .end_frame = end_frame,
libavcodec/dxva2_vc1.c+2−2
@@ -269,7 +269,7 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = { · 268 unmodified lines
269 .name = "wmv3_dxva2",269 .name = "wmv3_dxva2",
270 .type = AVMEDIA_TYPE_VIDEO,270 .type = AVMEDIA_TYPE_VIDEO,
271 .id = AV_CODEC_ID_WMV3,271 .id = AV_CODEC_ID_WMV3,
272 .pix_fmt = PIX_FMT_DXVA2_VLD,272 .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
273 .start_frame = start_frame,273 .start_frame = start_frame,
274 .decode_slice = decode_slice,274 .decode_slice = decode_slice,
275 .end_frame = end_frame,275 .end_frame = end_frame,
@@ -281,7 +281,7 @@ AVHWAccel ff_vc1_dxva2_hwaccel = { · 5 unmodified lines
281 .name = "vc1_dxva2",281 .name = "vc1_dxva2",
282 .type = AVMEDIA_TYPE_VIDEO,282 .type = AVMEDIA_TYPE_VIDEO,
283 .id = AV_CODEC_ID_VC1,283 .id = AV_CODEC_ID_VC1,
284 .pix_fmt = PIX_FMT_DXVA2_VLD,284 .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
285 .start_frame = start_frame,285 .start_frame = start_frame,
286 .decode_slice = decode_slice,286 .decode_slice = decode_slice,
287 .end_frame = end_frame,287 .end_frame = end_frame,
libavcodec/eacmv.c+1−1
@@ -45,7 +45,7 @@ typedef struct CmvContext { · 44 unmodified lines
45static av_cold int cmv_decode_init(AVCodecContext *avctx){45static av_cold int cmv_decode_init(AVCodecContext *avctx){
46 CmvContext *s = avctx->priv_data;46 CmvContext *s = avctx->priv_data;
47 s->avctx = avctx;47 s->avctx = avctx;
48 avctx->pix_fmt = PIX_FMT_PAL8;48 avctx->pix_fmt = AV_PIX_FMT_PAL8;
49 return 0;49 return 0;
50}50}
51 51
libavcodec/eamad.c+1−1
@@ -61,7 +61,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 60 unmodified lines
61{61{
62 MadContext *s = avctx->priv_data;62 MadContext *s = avctx->priv_data;
63 s->avctx = avctx;63 s->avctx = avctx;
64 avctx->pix_fmt = PIX_FMT_YUV420P;64 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
65 ff_dsputil_init(&s->dsp, avctx);65 ff_dsputil_init(&s->dsp, avctx);
66 ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);66 ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM);
67 ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);67 ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
libavcodec/eatgq.c+1−1
@@ -53,7 +53,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){ · 52 unmodified lines
53 ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM);53 ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM);
54 ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);54 ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);
55 avctx->time_base = (AVRational){1, 15};55 avctx->time_base = (AVRational){1, 15};
56 avctx->pix_fmt = PIX_FMT_YUV420P;56 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
57 return 0;57 return 0;
58}58}
59 59
libavcodec/eatgv.c+1−1
@@ -54,7 +54,7 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){ · 53 unmodified lines
54 TgvContext *s = avctx->priv_data;54 TgvContext *s = avctx->priv_data;
55 s->avctx = avctx;55 s->avctx = avctx;
56 avctx->time_base = (AVRational){1, 15};56 avctx->time_base = (AVRational){1, 15};
57 avctx->pix_fmt = PIX_FMT_PAL8;57 avctx->pix_fmt = AV_PIX_FMT_PAL8;
58 return 0;58 return 0;
59}59}
60 60
libavcodec/eatqi.c+1−1
@@ -52,7 +52,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx) · 51 unmodified lines
52 ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);52 ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
53 s->qscale = 1;53 s->qscale = 1;
54 avctx->time_base = (AVRational){1, 15};54 avctx->time_base = (AVRational){1, 15};
55 avctx->pix_fmt = PIX_FMT_YUV420P;55 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
56 ff_mpeg12_init_vlcs();56 ff_mpeg12_init_vlcs();
57 return 0;57 return 0;
58}58}
libavcodec/escape124.c+1−1
@@ -61,7 +61,7 @@ static av_cold int escape124_decode_init(AVCodecContext *avctx) · 60 unmodified lines
61{61{
62 Escape124Context *s = avctx->priv_data;62 Escape124Context *s = avctx->priv_data;
63 63
64 avctx->pix_fmt = PIX_FMT_RGB555;64 avctx->pix_fmt = AV_PIX_FMT_RGB555;
65 65
66 s->num_superblocks = ((unsigned)avctx->width / 8) *66 s->num_superblocks = ((unsigned)avctx->width / 8) *
67 ((unsigned)avctx->height / 8);67 ((unsigned)avctx->height / 8);
libavcodec/ffv1.c+22−22
@@ -901,9 +901,9 @@ static av_cold int encode_init(AVCodecContext *avctx) · 900 unmodified lines
901 901
902 avctx->coded_frame= &s->picture;902 avctx->coded_frame= &s->picture;
903 switch(avctx->pix_fmt){903 switch(avctx->pix_fmt){
904 case PIX_FMT_YUV444P16:904 case AV_PIX_FMT_YUV444P16:
905 case PIX_FMT_YUV422P16:905 case AV_PIX_FMT_YUV422P16:
906 case PIX_FMT_YUV420P16:906 case AV_PIX_FMT_YUV420P16:
907 if(avctx->bits_per_raw_sample <=8){907 if(avctx->bits_per_raw_sample <=8){
908 av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");908 av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");
909 return -1;909 return -1;
@@ -913,14 +913,14 @@ static av_cold int encode_init(AVCodecContext *avctx) · 3 unmodified lines
913 return -1;913 return -1;
914 }914 }
915 s->version= FFMAX(s->version, 1);915 s->version= FFMAX(s->version, 1);
916 case PIX_FMT_YUV444P:916 case AV_PIX_FMT_YUV444P:
917 case PIX_FMT_YUV422P:917 case AV_PIX_FMT_YUV422P:
918 case PIX_FMT_YUV420P:918 case AV_PIX_FMT_YUV420P:
919 case PIX_FMT_YUV411P:919 case AV_PIX_FMT_YUV411P:
920 case PIX_FMT_YUV410P:920 case AV_PIX_FMT_YUV410P:
921 s->colorspace= 0;921 s->colorspace= 0;
922 break;922 break;
923 case PIX_FMT_RGB32:923 case AV_PIX_FMT_RGB32:
924 s->colorspace= 1;924 s->colorspace= 1;
925 break;925 break;
926 default:926 default:
@@ -1547,20 +1547,20 @@ static int read_header(FFV1Context *f){ · 620 unmodified lines
1547 if(f->colorspace==0){1547 if(f->colorspace==0){
1548 if(f->avctx->bits_per_raw_sample<=8){1548 if(f->avctx->bits_per_raw_sample<=8){
1549 switch(16*f->chroma_h_shift + f->chroma_v_shift){1549 switch(16*f->chroma_h_shift + f->chroma_v_shift){
1550 case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break;1550 case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P; break;
1551 case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break;1551 case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P; break;
1552 case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break;1552 case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P; break;
1553 case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break;1553 case 0x20: f->avctx->pix_fmt= AV_PIX_FMT_YUV411P; break;
1554 case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break;1554 case 0x22: f->avctx->pix_fmt= AV_PIX_FMT_YUV410P; break;
1555 default:1555 default:
1556 av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");1556 av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
1557 return -1;1557 return -1;
1558 }1558 }
1559 }else{1559 }else{
1560 switch(16*f->chroma_h_shift + f->chroma_v_shift){1560 switch(16*f->chroma_h_shift + f->chroma_v_shift){
1561 case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break;1561 case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P16; break;
1562 case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break;1562 case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P16; break;
1563 case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break;1563 case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P16; break;
1564 default:1564 default:
1565 av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");1565 av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
1566 return -1;1566 return -1;
@@ -1571,7 +1571,7 @@ static int read_header(FFV1Context *f){ · 4 unmodified lines
1571 av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");1571 av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");
1572 return -1;1572 return -1;
1573 }1573 }
1574 f->avctx->pix_fmt= PIX_FMT_RGB32;1574 f->avctx->pix_fmt= AV_PIX_FMT_RGB32;
1575 }else{1575 }else{
1576 av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");1576 av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
1577 return -1;1577 return -1;
@@ -1759,10 +1759,10 @@ AVCodec ff_ffv1_encoder = { · 181 unmodified lines
1759 .encode2 = encode_frame,1759 .encode2 = encode_frame,
1760 .close = common_end,1760 .close = common_end,
1761 .capabilities = CODEC_CAP_SLICE_THREADS,1761 .capabilities = CODEC_CAP_SLICE_THREADS,
1762 .pix_fmts = (const enum PixelFormat[]){1762 .pix_fmts = (const enum AVPixelFormat[]){
1763 PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P,1763 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
1764 PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16,1764 AV_PIX_FMT_YUV410P, AV_PIX_FMT_RGB32, AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16,
1765 PIX_FMT_YUV444P16, PIX_FMT_NONE1765 AV_PIX_FMT_YUV444P16, AV_PIX_FMT_NONE
1766 },1766 },
1767 .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),1767 .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
1768};1768};
libavcodec/flashsv.c+3−3
@@ -114,7 +114,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx) · 113 unmodified lines
114 av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);114 av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
115 return 1;115 return 1;
116 }116 }
117 avctx->pix_fmt = PIX_FMT_BGR24;117 avctx->pix_fmt = AV_PIX_FMT_BGR24;
118 s->frame.data[0] = NULL;118 s->frame.data[0] = NULL;
119 119
120 return 0;120 return 0;
@@ -461,7 +461,7 @@ AVCodec ff_flashsv_decoder = { · 340 unmodified lines
461 .close = flashsv_decode_end,461 .close = flashsv_decode_end,
462 .decode = flashsv_decode_frame,462 .decode = flashsv_decode_frame,
463 .capabilities = CODEC_CAP_DR1,463 .capabilities = CODEC_CAP_DR1,
464 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE },464 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
465 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),465 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),
466};466};
467#endif /* CONFIG_FLASHSV_DECODER */467#endif /* CONFIG_FLASHSV_DECODER */
@@ -524,7 +524,7 @@ AVCodec ff_flashsv2_decoder = { · 56 unmodified lines
524 .close = flashsv2_decode_end,524 .close = flashsv2_decode_end,
525 .decode = flashsv_decode_frame,525 .decode = flashsv_decode_frame,
526 .capabilities = CODEC_CAP_DR1,526 .capabilities = CODEC_CAP_DR1,
527 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE },527 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
528 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"),528 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"),
529};529};
530#endif /* CONFIG_FLASHSV2_DECODER */530#endif /* CONFIG_FLASHSV2_DECODER */
libavcodec/flashsvenc.c+1−1
@@ -287,6 +287,6 @@ AVCodec ff_flashsv_encoder = { · 286 unmodified lines
287 .init = flashsv_encode_init,287 .init = flashsv_encode_init,
288 .encode2 = flashsv_encode_frame,288 .encode2 = flashsv_encode_frame,
289 .close = flashsv_encode_end,289 .close = flashsv_encode_end,
290 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE },290 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
291 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"),291 .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"),
292};292};
libavcodec/flicvideo.c+8−8
@@ -111,10 +111,10 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) · 110 unmodified lines
111 }111 }
112 112
113 switch (depth) {113 switch (depth) {
114 case 8 : avctx->pix_fmt = PIX_FMT_PAL8; break;114 case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break;
115 case 15 : avctx->pix_fmt = PIX_FMT_RGB555; break;115 case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
116 case 16 : avctx->pix_fmt = PIX_FMT_RGB565; break;116 case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break;
117 case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */117 case 24 : avctx->pix_fmt = AV_PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */
118 av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");118 av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
119 return -1;119 return -1;
120 default :120 default :
@@ -701,16 +701,16 @@ static int flic_decode_frame(AVCodecContext *avctx, · 580 unmodified lines
701{701{
702 const uint8_t *buf = avpkt->data;702 const uint8_t *buf = avpkt->data;
703 int buf_size = avpkt->size;703 int buf_size = avpkt->size;
704 if (avctx->pix_fmt == PIX_FMT_PAL8) {704 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
705 return flic_decode_frame_8BPP(avctx, data, data_size,705 return flic_decode_frame_8BPP(avctx, data, data_size,
706 buf, buf_size);706 buf, buf_size);
707 }707 }
708 else if ((avctx->pix_fmt == PIX_FMT_RGB555) ||708 else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) ||
709 (avctx->pix_fmt == PIX_FMT_RGB565)) {709 (avctx->pix_fmt == AV_PIX_FMT_RGB565)) {
710 return flic_decode_frame_15_16BPP(avctx, data, data_size,710 return flic_decode_frame_15_16BPP(avctx, data, data_size,
711 buf, buf_size);711 buf, buf_size);
712 }712 }
713 else if (avctx->pix_fmt == PIX_FMT_BGR24) {713 else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) {
714 return flic_decode_frame_24BPP(avctx, data, data_size,714 return flic_decode_frame_24BPP(avctx, data, data_size,
715 buf, buf_size);715 buf, buf_size);
716 }716 }
libavcodec/flvenc.c+1−1
@@ -94,7 +94,7 @@ AVCodec ff_flv_encoder = { · 93 unmodified lines
94 .init = ff_MPV_encode_init,94 .init = ff_MPV_encode_init,
95 .encode2 = ff_MPV_encode_picture,95 .encode2 = ff_MPV_encode_picture,
96 .close = ff_MPV_encode_end,96 .close = ff_MPV_encode_end,
97 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },97 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
98 .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),98 .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
99 .priv_class = &flv_class,99 .priv_class = &flv_class,
100};100};
libavcodec/fraps.c+3−3
@@ -61,7 +61,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 60 unmodified lines
61 FrapsContext * const s = avctx->priv_data;61 FrapsContext * const s = avctx->priv_data;
62 62
63 avctx->coded_frame = &s->frame;63 avctx->coded_frame = &s->frame;
64 avctx->pix_fmt= PIX_FMT_NONE; /* set in decode_frame */64 avctx->pix_fmt= AV_PIX_FMT_NONE; /* set in decode_frame */
65 65
66 s->avctx = avctx;66 s->avctx = avctx;
67 s->tmpbuf = NULL;67 s->tmpbuf = NULL;
@@ -139,7 +139,7 @@ static int decode_frame(AVCodecContext *avctx, · 71 unmodified lines
139 uint32_t *luma1,*luma2,*cb,*cr;139 uint32_t *luma1,*luma2,*cb,*cr;
140 uint32_t offs[4];140 uint32_t offs[4];
141 int i, j, is_chroma, planes;141 int i, j, is_chroma, planes;
142 enum PixelFormat pix_fmt;142 enum AVPixelFormat pix_fmt;
143 143
144 header = AV_RL32(buf);144 header = AV_RL32(buf);
145 version = header & 0xff;145 version = header & 0xff;
@@ -156,7 +156,7 @@ static int decode_frame(AVCodecContext *avctx, · 10 unmodified lines
156 if (header_size == 8)156 if (header_size == 8)
157 buf+=4;157 buf+=4;
158 158
159 pix_fmt = version & 1 ? PIX_FMT_BGR24 : PIX_FMT_YUVJ420P;159 pix_fmt = version & 1 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
160 if (avctx->pix_fmt != pix_fmt && f->data[0]) {160 if (avctx->pix_fmt != pix_fmt && f->data[0]) {
161 avctx->release_buffer(avctx, f);161 avctx->release_buffer(avctx, f);
162 }162 }
libavcodec/frwu.c+1−1
@@ -29,7 +29,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 28 unmodified lines
29 av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n");29 av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n");
30 return AVERROR(EINVAL);30 return AVERROR(EINVAL);
31 }31 }
32 avctx->pix_fmt = PIX_FMT_UYVY422;32 avctx->pix_fmt = AV_PIX_FMT_UYVY422;
33 33
34 avctx->coded_frame = avcodec_alloc_frame();34 avctx->coded_frame = avcodec_alloc_frame();
35 if (!avctx->coded_frame)35 if (!avctx->coded_frame)
libavcodec/gif.c+3−3
@@ -187,9 +187,9 @@ AVCodec ff_gif_encoder = { · 186 unmodified lines
187 .init = gif_encode_init,187 .init = gif_encode_init,
188 .encode2 = gif_encode_frame,188 .encode2 = gif_encode_frame,
189 .close = gif_encode_close,189 .close = gif_encode_close,
190 .pix_fmts = (const enum PixelFormat[]){190 .pix_fmts = (const enum AVPixelFormat[]){
191 PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE,191 AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
192 PIX_FMT_GRAY8, PIX_FMT_PAL8, PIX_FMT_NONE192 AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE
193 },193 },
194 .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),194 .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
195};195};
libavcodec/gifdec.c+1−1
@@ -294,7 +294,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, A · 293 unmodified lines
294 if (gif_read_header1(s) < 0)294 if (gif_read_header1(s) < 0)
295 return -1;295 return -1;
296 296
297 avctx->pix_fmt = PIX_FMT_PAL8;297 avctx->pix_fmt = AV_PIX_FMT_PAL8;
298 if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx))298 if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx))
299 return -1;299 return -1;
300 avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);300 avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);
libavcodec/h261dec.c+1−1
@@ -85,7 +85,7 @@ static av_cold int h261_decode_init(AVCodecContext *avctx){ · 84 unmodified lines
85 85
86 s->out_format = FMT_H261;86 s->out_format = FMT_H261;
87 s->low_delay= 1;87 s->low_delay= 1;
88 avctx->pix_fmt= PIX_FMT_YUV420P;88 avctx->pix_fmt= AV_PIX_FMT_YUV420P;
89 89
90 s->codec_id= avctx->codec->id;90 s->codec_id= avctx->codec->id;
91 91
libavcodec/h261enc.c+1−1
@@ -331,7 +331,7 @@ AVCodec ff_h261_encoder = { · 330 unmodified lines
331 .init = ff_MPV_encode_init,331 .init = ff_MPV_encode_init,
332 .encode2 = ff_MPV_encode_picture,332 .encode2 = ff_MPV_encode_picture,
333 .close = ff_MPV_encode_end,333 .close = ff_MPV_encode_end,
334 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },334 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
335 .long_name = NULL_IF_CONFIG_SMALL("H.261"),335 .long_name = NULL_IF_CONFIG_SMALL("H.261"),
336 .priv_class = &h261_class,336 .priv_class = &h261_class,
337};337};
libavcodec/h263dec.c+1−1
@@ -59,7 +59,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 58 unmodified lines
59 s->decode_mb= ff_h263_decode_mb;59 s->decode_mb= ff_h263_decode_mb;
60 s->low_delay= 1;60 s->low_delay= 1;
61 if (avctx->codec->id == AV_CODEC_ID_MSS2)61 if (avctx->codec->id == AV_CODEC_ID_MSS2)
62 avctx->pix_fmt = PIX_FMT_YUV420P;62 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
63 else63 else
64 avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);64 avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
65 s->unrestricted_mv= 1;65 s->unrestricted_mv= 1;
libavcodec/h264.c+21−21
@@ -59,12 +59,12 @@ static const uint8_t div6[QP_MAX_NUM + 1] = { · 58 unmodified lines
59 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,59 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
60};60};
61 61
62static const enum PixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = {62static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = {
63 PIX_FMT_DXVA2_VLD,63 AV_PIX_FMT_DXVA2_VLD,
64 PIX_FMT_VAAPI_VLD,64 AV_PIX_FMT_VAAPI_VLD,
65 PIX_FMT_VDA_VLD,65 AV_PIX_FMT_VDA_VLD,
66 PIX_FMT_YUVJ420P,66 AV_PIX_FMT_YUVJ420P,
67 PIX_FMT_NONE67 AV_PIX_FMT_NONE
68};68};
69 69
70/**70/**
@@ -2502,35 +2502,35 @@ static int decode_slice_header(H264Context *h, H264Context *h0) · 2431 unmodified lines
2502 case 9:2502 case 9:
2503 if (CHROMA444) {2503 if (CHROMA444) {
2504 if (s->avctx->colorspace == AVCOL_SPC_RGB) {2504 if (s->avctx->colorspace == AVCOL_SPC_RGB) {
2505 s->avctx->pix_fmt = PIX_FMT_GBRP9;2505 s->avctx->pix_fmt = AV_PIX_FMT_GBRP9;
2506 } else2506 } else
2507 s->avctx->pix_fmt = PIX_FMT_YUV444P9;2507 s->avctx->pix_fmt = AV_PIX_FMT_YUV444P9;
2508 } else if (CHROMA422)2508 } else if (CHROMA422)
2509 s->avctx->pix_fmt = PIX_FMT_YUV422P9;2509 s->avctx->pix_fmt = AV_PIX_FMT_YUV422P9;
2510 else2510 else
2511 s->avctx->pix_fmt = PIX_FMT_YUV420P9;2511 s->avctx->pix_fmt = AV_PIX_FMT_YUV420P9;
2512 break;2512 break;
2513 case 10:2513 case 10:
2514 if (CHROMA444) {2514 if (CHROMA444) {
2515 if (s->avctx->colorspace == AVCOL_SPC_RGB) {2515 if (s->avctx->colorspace == AVCOL_SPC_RGB) {
2516 s->avctx->pix_fmt = PIX_FMT_GBRP10;2516 s->avctx->pix_fmt = AV_PIX_FMT_GBRP10;
2517 } else2517 } else
2518 s->avctx->pix_fmt = PIX_FMT_YUV444P10;2518 s->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
2519 } else if (CHROMA422)2519 } else if (CHROMA422)
2520 s->avctx->pix_fmt = PIX_FMT_YUV422P10;2520 s->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
2521 else2521 else
2522 s->avctx->pix_fmt = PIX_FMT_YUV420P10;2522 s->avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
2523 break;2523 break;
2524 case 8:2524 case 8:
2525 if (CHROMA444) {2525 if (CHROMA444) {
2526 if (s->avctx->colorspace == AVCOL_SPC_RGB) {2526 if (s->avctx->colorspace == AVCOL_SPC_RGB) {
2527 s->avctx->pix_fmt = PIX_FMT_GBRP;2527 s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
2528 } else2528 } else
2529 s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ444P2529 s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
2530 : PIX_FMT_YUV444P;2530 : AV_PIX_FMT_YUV444P;
2531 } else if (CHROMA422) {2531 } else if (CHROMA422) {
2532 s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ422P2532 s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
2533 : PIX_FMT_YUV422P;2533 : AV_PIX_FMT_YUV422P;
2534 } else {2534 } else {
2535 s->avctx->pix_fmt = s->avctx->get_format(s->avctx,2535 s->avctx->pix_fmt = s->avctx->get_format(s->avctx,
2536 s->avctx->codec->pix_fmts ?2536 s->avctx->codec->pix_fmts ?
@@ -4125,8 +4125,8 @@ AVCodec ff_h264_vdpau_decoder = { · 1588 unmodified lines
4125 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,4125 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
4126 .flush = flush_dpb,4126 .flush = flush_dpb,
4127 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"),4127 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"),
4128 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_VDPAU_H264,4128 .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VDPAU_H264,
4129 PIX_FMT_NONE},4129 AV_PIX_FMT_NONE},
4130 .profiles = NULL_IF_CONFIG_SMALL(profiles),4130 .profiles = NULL_IF_CONFIG_SMALL(profiles),
4131};4131};
4132#endif4132#endif
libavcodec/huffyuv.c+16−16
@@ -456,21 +456,21 @@ static av_cold int decode_init(AVCodecContext *avctx) · 455 unmodified lines
456 456
457 switch (s->bitstream_bpp) {457 switch (s->bitstream_bpp) {
458 case 12:458 case 12:
459 avctx->pix_fmt = PIX_FMT_YUV420P;459 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
460 break;460 break;
461 case 16:461 case 16:
462 if (s->yuy2) {462 if (s->yuy2) {
463 avctx->pix_fmt = PIX_FMT_YUYV422;463 avctx->pix_fmt = AV_PIX_FMT_YUYV422;
464 } else {464 } else {
465 avctx->pix_fmt = PIX_FMT_YUV422P;465 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
466 }466 }
467 break;467 break;
468 case 24:468 case 24:
469 case 32:469 case 32:
470 if (s->bgr32) {470 if (s->bgr32) {
471 avctx->pix_fmt = PIX_FMT_RGB32;471 avctx->pix_fmt = AV_PIX_FMT_RGB32;
472 } else {472 } else {
473 avctx->pix_fmt = PIX_FMT_BGR24;473 avctx->pix_fmt = AV_PIX_FMT_BGR24;
474 }474 }
475 break;475 break;
476 default:476 default:
@@ -545,13 +545,13 @@ static av_cold int encode_init(AVCodecContext *avctx) · 68 unmodified lines
545 avctx->coded_frame = &s->picture;545 avctx->coded_frame = &s->picture;
546 546
547 switch (avctx->pix_fmt) {547 switch (avctx->pix_fmt) {
548 case PIX_FMT_YUV420P:548 case AV_PIX_FMT_YUV420P:
549 s->bitstream_bpp = 12;549 s->bitstream_bpp = 12;
550 break;550 break;
551 case PIX_FMT_YUV422P:551 case AV_PIX_FMT_YUV422P:
552 s->bitstream_bpp = 16;552 s->bitstream_bpp = 16;
553 break;553 break;
554 case PIX_FMT_RGB32:554 case AV_PIX_FMT_RGB32:
555 s->bitstream_bpp = 24;555 s->bitstream_bpp = 24;
556 break;556 break;
557 default:557 default:
@@ -573,7 +573,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 15 unmodified lines
573 }else s->context= 0;573 }else s->context= 0;
574 574
575 if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) {575 if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) {
576 if (avctx->pix_fmt == PIX_FMT_YUV420P) {576 if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
577 av_log(avctx, AV_LOG_ERROR,577 av_log(avctx, AV_LOG_ERROR,
578 "Error: YV12 is not supported by huffyuv; use "578 "Error: YV12 is not supported by huffyuv; use "
579 "vcodec=ffvhuff or format=422p\n");579 "vcodec=ffvhuff or format=422p\n");
@@ -1256,8 +1256,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 676 unmodified lines
1256 1256
1257 init_put_bits(&s->pb, pkt->data + size, pkt->size - size);1257 init_put_bits(&s->pb, pkt->data + size, pkt->size - size);
1258 1258
1259 if (avctx->pix_fmt == PIX_FMT_YUV422P ||1259 if (avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
1260 avctx->pix_fmt == PIX_FMT_YUV420P) {1260 avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
1261 int lefty, leftu, leftv, y, cy;1261 int lefty, leftu, leftv, y, cy;
1262 1262
1263 put_bits(&s->pb, 8, leftv = p->data[2][0]);1263 put_bits(&s->pb, 8, leftv = p->data[2][0]);
@@ -1361,7 +1361,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 97 unmodified lines
1361 encode_422_bitstream(s, 0, width);1361 encode_422_bitstream(s, 0, width);
1362 }1362 }
1363 }1363 }
1364 } else if(avctx->pix_fmt == PIX_FMT_RGB32) {1364 } else if(avctx->pix_fmt == AV_PIX_FMT_RGB32) {
1365 uint8_t *data = p->data[0] + (height - 1) * p->linesize[0];1365 uint8_t *data = p->data[0] + (height - 1) * p->linesize[0];
1366 const int stride = -p->linesize[0];1366 const int stride = -p->linesize[0];
1367 const int fake_stride = -fake_ystride;1367 const int fake_stride = -fake_ystride;
@@ -1479,8 +1479,8 @@ AVCodec ff_huffyuv_encoder = { · 111 unmodified lines
1479 .init = encode_init,1479 .init = encode_init,
1480 .encode2 = encode_frame,1480 .encode2 = encode_frame,
1481 .close = encode_end,1481 .close = encode_end,
1482 .pix_fmts = (const enum PixelFormat[]){1482 .pix_fmts = (const enum AVPixelFormat[]){
1483 PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE1483 AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
1484 },1484 },
1485 .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),1485 .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
1486};1486};
@@ -1495,8 +1495,8 @@ AVCodec ff_ffvhuff_encoder = { · 8 unmodified lines
1495 .init = encode_init,1495 .init = encode_init,
1496 .encode2 = encode_frame,1496 .encode2 = encode_frame,
1497 .close = encode_end,1497 .close = encode_end,
1498 .pix_fmts = (const enum PixelFormat[]){1498 .pix_fmts = (const enum AVPixelFormat[]){
1499 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE1499 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
1500 },1500 },
1501 .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),1501 .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
1502};1502};
libavcodec/idcinvideo.c+1−1
@@ -151,7 +151,7 @@ static av_cold int idcin_decode_init(AVCodecContext *avctx) · 150 unmodified lines
151 unsigned char *histograms;151 unsigned char *histograms;
152 152
153 s->avctx = avctx;153 s->avctx = avctx;
154 avctx->pix_fmt = PIX_FMT_PAL8;154 avctx->pix_fmt = AV_PIX_FMT_PAL8;
155 155
156 /* make sure the Huffman tables make it */156 /* make sure the Huffman tables make it */
157 if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {157 if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
libavcodec/iff.c+10−10
@@ -152,10 +152,10 @@ static av_cold int decode_init(AVCodecContext *avctx) · 151 unmodified lines
152 152
153 if (avctx->bits_per_coded_sample <= 8) {153 if (avctx->bits_per_coded_sample <= 8) {
154 avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 ||154 avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 ||
155 avctx->extradata_size) ? PIX_FMT_PAL8155 avctx->extradata_size) ? AV_PIX_FMT_PAL8
156 : PIX_FMT_GRAY8;156 : AV_PIX_FMT_GRAY8;
157 } else if (avctx->bits_per_coded_sample <= 32) {157 } else if (avctx->bits_per_coded_sample <= 32) {
158 avctx->pix_fmt = PIX_FMT_BGR32;158 avctx->pix_fmt = AV_PIX_FMT_BGR32;
159 } else {159 } else {
160 return AVERROR_INVALIDDATA;160 return AVERROR_INVALIDDATA;
161 }161 }
@@ -263,14 +263,14 @@ static int decode_frame_ilbm(AVCodecContext *avctx, · 101 unmodified lines
263 } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {263 } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
264 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");264 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
265 return res;265 return res;
266 } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) {266 } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
267 if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)267 if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
268 return res;268 return res;
269 }269 }
270 s->init = 1;270 s->init = 1;
271 271
272 if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved272 if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
273 if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) {273 if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
274 for(y = 0; y < avctx->height; y++ ) {274 for(y = 0; y < avctx->height; y++ ) {
275 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];275 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
276 memset(row, 0, avctx->width);276 memset(row, 0, avctx->width);
@@ -279,7 +279,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx, · 2 unmodified lines
279 buf += s->planesize;279 buf += s->planesize;
280 }280 }
281 }281 }
282 } else { // PIX_FMT_BGR32282 } else { // AV_PIX_FMT_BGR32
283 for(y = 0; y < avctx->height; y++ ) {283 for(y = 0; y < avctx->height; y++ ) {
284 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];284 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];
285 memset(row, 0, avctx->width << 2);285 memset(row, 0, avctx->width << 2);
@@ -289,7 +289,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx, · 3 unmodified lines
289 }289 }
290 }290 }
291 }291 }
292 } else if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { // IFF-PBM292 } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { // IFF-PBM
293 for(y = 0; y < avctx->height; y++ ) {293 for(y = 0; y < avctx->height; y++ ) {
294 uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];294 uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];
295 memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));295 memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));
@@ -320,14 +320,14 @@ static int decode_frame_byterun1(AVCodecContext *avctx, · 24 unmodified lines
320 } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {320 } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
321 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");321 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
322 return res;322 return res;
323 } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) {323 } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
324 if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)324 if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
325 return res;325 return res;
326 }326 }
327 s->init = 1;327 s->init = 1;
328 328
329 if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved329 if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved
330 if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) {330 if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
331 for(y = 0; y < avctx->height ; y++ ) {331 for(y = 0; y < avctx->height ; y++ ) {
332 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];332 uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
333 memset(row, 0, avctx->width);333 memset(row, 0, avctx->width);
@@ -336,7 +336,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx, · 2 unmodified lines
336 decodeplane8(row, s->planebuf, s->planesize, plane);336 decodeplane8(row, s->planebuf, s->planesize, plane);
337 }337 }
338 }338 }
339 } else { //PIX_FMT_BGR32339 } else { //AV_PIX_FMT_BGR32
340 for(y = 0; y < avctx->height ; y++ ) {340 for(y = 0; y < avctx->height ; y++ ) {
341 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];341 uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];
342 memset(row, 0, avctx->width << 2);342 memset(row, 0, avctx->width << 2);
libavcodec/imgconvert.c+116−116
@@ -68,87 +68,87 @@ typedef struct PixFmtInfo { · 67 unmodified lines
68} PixFmtInfo;68} PixFmtInfo;
69 69
70/* this table gives more information about formats */70/* this table gives more information about formats */
71static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {71static const PixFmtInfo pix_fmt_info[AV_PIX_FMT_NB] = {
72 /* YUV formats */72 /* YUV formats */
73 [PIX_FMT_YUV420P] = {73 [AV_PIX_FMT_YUV420P] = {
74 .nb_channels = 3,74 .nb_channels = 3,
75 .color_type = FF_COLOR_YUV,75 .color_type = FF_COLOR_YUV,
76 .pixel_type = FF_PIXEL_PLANAR,76 .pixel_type = FF_PIXEL_PLANAR,
77 .depth = 8,77 .depth = 8,
78 },78 },
79 [PIX_FMT_YUV422P] = {79 [AV_PIX_FMT_YUV422P] = {
80 .nb_channels = 3,80 .nb_channels = 3,
81 .color_type = FF_COLOR_YUV,81 .color_type = FF_COLOR_YUV,
82 .pixel_type = FF_PIXEL_PLANAR,82 .pixel_type = FF_PIXEL_PLANAR,
83 .depth = 8,83 .depth = 8,
84 },84 },
85 [PIX_FMT_YUV444P] = {85 [AV_PIX_FMT_YUV444P] = {
86 .nb_channels = 3,86 .nb_channels = 3,
87 .color_type = FF_COLOR_YUV,87 .color_type = FF_COLOR_YUV,
88 .pixel_type = FF_PIXEL_PLANAR,88 .pixel_type = FF_PIXEL_PLANAR,
89 .depth = 8,89 .depth = 8,
90 },90 },
91 [PIX_FMT_YUYV422] = {91 [AV_PIX_FMT_YUYV422] = {
92 .nb_channels = 1,92 .nb_channels = 1,
93 .color_type = FF_COLOR_YUV,93 .color_type = FF_COLOR_YUV,
94 .pixel_type = FF_PIXEL_PACKED,94 .pixel_type = FF_PIXEL_PACKED,
95 .depth = 8,95 .depth = 8,
96 },96 },
97 [PIX_FMT_UYVY422] = {97 [AV_PIX_FMT_UYVY422] = {
98 .nb_channels = 1,98 .nb_channels = 1,
99 .color_type = FF_COLOR_YUV,99 .color_type = FF_COLOR_YUV,
100 .pixel_type = FF_PIXEL_PACKED,100 .pixel_type = FF_PIXEL_PACKED,
101 .depth = 8,101 .depth = 8,
102 },102 },
103 [PIX_FMT_YUV410P] = {103 [AV_PIX_FMT_YUV410P] = {
104 .nb_channels = 3,104 .nb_channels = 3,
105 .color_type = FF_COLOR_YUV,105 .color_type = FF_COLOR_YUV,
106 .pixel_type = FF_PIXEL_PLANAR,106 .pixel_type = FF_PIXEL_PLANAR,
107 .depth = 8,107 .depth = 8,
108 },108 },
109 [PIX_FMT_YUV411P] = {109 [AV_PIX_FMT_YUV411P] = {
110 .nb_channels = 3,110 .nb_channels = 3,
111 .color_type = FF_COLOR_YUV,111 .color_type = FF_COLOR_YUV,
112 .pixel_type = FF_PIXEL_PLANAR,112 .pixel_type = FF_PIXEL_PLANAR,
113 .depth = 8,113 .depth = 8,
114 },114 },
115 [PIX_FMT_YUV440P] = {115 [AV_PIX_FMT_YUV440P] = {
116 .nb_channels = 3,116 .nb_channels = 3,
117 .color_type = FF_COLOR_YUV,117 .color_type = FF_COLOR_YUV,
118 .pixel_type = FF_PIXEL_PLANAR,118 .pixel_type = FF_PIXEL_PLANAR,
119 .depth = 8,119 .depth = 8,
120 },120 },
121 [PIX_FMT_YUV420P16LE] = {121 [AV_PIX_FMT_YUV420P16LE] = {
122 .nb_channels = 3,122 .nb_channels = 3,
123 .color_type = FF_COLOR_YUV,123 .color_type = FF_COLOR_YUV,
124 .pixel_type = FF_PIXEL_PLANAR,124 .pixel_type = FF_PIXEL_PLANAR,
125 .depth = 16,125 .depth = 16,
126 },126 },
127 [PIX_FMT_YUV422P16LE] = {127 [AV_PIX_FMT_YUV422P16LE] = {
128 .nb_channels = 3,128 .nb_channels = 3,
129 .color_type = FF_COLOR_YUV,129 .color_type = FF_COLOR_YUV,
130 .pixel_type = FF_PIXEL_PLANAR,130 .pixel_type = FF_PIXEL_PLANAR,
131 .depth = 16,131 .depth = 16,
132 },132 },
133 [PIX_FMT_YUV444P16LE] = {133 [AV_PIX_FMT_YUV444P16LE] = {
134 .nb_channels = 3,134 .nb_channels = 3,
135 .color_type = FF_COLOR_YUV,135 .color_type = FF_COLOR_YUV,
136 .pixel_type = FF_PIXEL_PLANAR,136 .pixel_type = FF_PIXEL_PLANAR,
137 .depth = 16,137 .depth = 16,
138 },138 },
139 [PIX_FMT_YUV420P16BE] = {139 [AV_PIX_FMT_YUV420P16BE] = {
140 .nb_channels = 3,140 .nb_channels = 3,
141 .color_type = FF_COLOR_YUV,141 .color_type = FF_COLOR_YUV,
142 .pixel_type = FF_PIXEL_PLANAR,142 .pixel_type = FF_PIXEL_PLANAR,
143 .depth = 16,143 .depth = 16,
144 },144 },
145 [PIX_FMT_YUV422P16BE] = {145 [AV_PIX_FMT_YUV422P16BE] = {
146 .nb_channels = 3,146 .nb_channels = 3,
147 .color_type = FF_COLOR_YUV,147 .color_type = FF_COLOR_YUV,
148 .pixel_type = FF_PIXEL_PLANAR,148 .pixel_type = FF_PIXEL_PLANAR,
149 .depth = 16,149 .depth = 16,
150 },150 },
151 [PIX_FMT_YUV444P16BE] = {151 [AV_PIX_FMT_YUV444P16BE] = {
152 .nb_channels = 3,152 .nb_channels = 3,
153 .color_type = FF_COLOR_YUV,153 .color_type = FF_COLOR_YUV,
154 .pixel_type = FF_PIXEL_PLANAR,154 .pixel_type = FF_PIXEL_PLANAR,
@@ -157,7 +157,7 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { · 2 unmodified lines
157 157
158 158
159 /* YUV formats with alpha plane */159 /* YUV formats with alpha plane */
160 [PIX_FMT_YUVA420P] = {160 [AV_PIX_FMT_YUVA420P] = {
161 .nb_channels = 4,161 .nb_channels = 4,
162 .color_type = FF_COLOR_YUV,162 .color_type = FF_COLOR_YUV,
163 .pixel_type = FF_PIXEL_PLANAR,163 .pixel_type = FF_PIXEL_PLANAR,
@@ -165,25 +165,25 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { · 1 unmodified line
165 },165 },
166 166
167 /* JPEG YUV */167 /* JPEG YUV */
168 [PIX_FMT_YUVJ420P] = {168 [AV_PIX_FMT_YUVJ420P] = {
169 .nb_channels = 3,169 .nb_channels = 3,
170 .color_type = FF_COLOR_YUV_JPEG,170 .color_type = FF_COLOR_YUV_JPEG,
171 .pixel_type = FF_PIXEL_PLANAR,171 .pixel_type = FF_PIXEL_PLANAR,
172 .depth = 8,172 .depth = 8,
173 },173 },
174 [PIX_FMT_YUVJ422P] = {174 [AV_PIX_FMT_YUVJ422P] = {
175 .nb_channels = 3,175 .nb_channels = 3,
176 .color_type = FF_COLOR_YUV_JPEG,176 .color_type = FF_COLOR_YUV_JPEG,
177 .pixel_type = FF_PIXEL_PLANAR,177 .pixel_type = FF_PIXEL_PLANAR,
178 .depth = 8,178 .depth = 8,
179 },179 },
180 [PIX_FMT_YUVJ444P] = {180 [AV_PIX_FMT_YUVJ444P] = {
181 .nb_channels = 3,181 .nb_channels = 3,
182 .color_type = FF_COLOR_YUV_JPEG,182 .color_type = FF_COLOR_YUV_JPEG,
183 .pixel_type = FF_PIXEL_PLANAR,183 .pixel_type = FF_PIXEL_PLANAR,
184 .depth = 8,184 .depth = 8,
185 },185 },
186 [PIX_FMT_YUVJ440P] = {186 [AV_PIX_FMT_YUVJ440P] = {
187 .nb_channels = 3,187 .nb_channels = 3,
188 .color_type = FF_COLOR_YUV_JPEG,188 .color_type = FF_COLOR_YUV_JPEG,
189 .pixel_type = FF_PIXEL_PLANAR,189 .pixel_type = FF_PIXEL_PLANAR,
@@ -191,67 +191,67 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { · 1 unmodified line
191 },191 },
192 192
193 /* RGB formats */193 /* RGB formats */
194 [PIX_FMT_RGB24] = {194 [AV_PIX_FMT_RGB24] = {
195 .nb_channels = 3,195 .nb_channels = 3,
196 .color_type = FF_COLOR_RGB,196 .color_type = FF_COLOR_RGB,
197 .pixel_type = FF_PIXEL_PACKED,197 .pixel_type = FF_PIXEL_PACKED,
198 .depth = 8,198 .depth = 8,
199 },199 },
200 [PIX_FMT_BGR24] = {200 [AV_PIX_FMT_BGR24] = {
201 .nb_channels = 3,201 .nb_channels = 3,
202 .color_type = FF_COLOR_RGB,202 .color_type = FF_COLOR_RGB,
203 .pixel_type = FF_PIXEL_PACKED,203 .pixel_type = FF_PIXEL_PACKED,
204 .depth = 8,204 .depth = 8,
205 },205 },
206 [PIX_FMT_ARGB] = {206 [AV_PIX_FMT_ARGB] = {
207 .nb_channels = 4, .is_alpha = 1,207 .nb_channels = 4, .is_alpha = 1,
208 .color_type = FF_COLOR_RGB,208 .color_type = FF_COLOR_RGB,
209 .pixel_type = FF_PIXEL_PACKED,209 .pixel_type = FF_PIXEL_PACKED,
210 .depth = 8,210 .depth = 8,
211 },211 },
212 [PIX_FMT_RGB48BE] = {212 [AV_PIX_FMT_RGB48BE] = {
213 .nb_channels = 3,213 .nb_channels = 3,
214 .color_type = FF_COLOR_RGB,214 .color_type = FF_COLOR_RGB,
215 .pixel_type = FF_PIXEL_PACKED,215 .pixel_type = FF_PIXEL_PACKED,
216 .depth = 16,216 .depth = 16,
217 },217 },
218 [PIX_FMT_RGB48LE] = {218 [AV_PIX_FMT_RGB48LE] = {
219 .nb_channels = 3,219 .nb_channels = 3,
220 .color_type = FF_COLOR_RGB,220 .color_type = FF_COLOR_RGB,
221 .pixel_type = FF_PIXEL_PACKED,221 .pixel_type = FF_PIXEL_PACKED,
222 .depth = 16,222 .depth = 16,
223 },223 },
224 [PIX_FMT_RGB565BE] = {224 [AV_PIX_FMT_RGB565BE] = {
225 .nb_channels = 3,225 .nb_channels = 3,
226 .color_type = FF_COLOR_RGB,226 .color_type = FF_COLOR_RGB,
227 .pixel_type = FF_PIXEL_PACKED,227 .pixel_type = FF_PIXEL_PACKED,
228 .depth = 5,228 .depth = 5,
229 },229 },
230 [PIX_FMT_RGB565LE] = {230 [AV_PIX_FMT_RGB565LE] = {
231 .nb_channels = 3,231 .nb_channels = 3,
232 .color_type = FF_COLOR_RGB,232 .color_type = FF_COLOR_RGB,
233 .pixel_type = FF_PIXEL_PACKED,233 .pixel_type = FF_PIXEL_PACKED,
234 .depth = 5,234 .depth = 5,
235 },235 },
236 [PIX_FMT_RGB555BE] = {236 [AV_PIX_FMT_RGB555BE] = {
237 .nb_channels = 3,237 .nb_channels = 3,
238 .color_type = FF_COLOR_RGB,238 .color_type = FF_COLOR_RGB,
239 .pixel_type = FF_PIXEL_PACKED,239 .pixel_type = FF_PIXEL_PACKED,
240 .depth = 5,240 .depth = 5,
241 },241 },
242 [PIX_FMT_RGB555LE] = {242 [AV_PIX_FMT_RGB555LE] = {
243 .nb_channels = 3,243 .nb_channels = 3,
244 .color_type = FF_COLOR_RGB,244 .color_type = FF_COLOR_RGB,
245 .pixel_type = FF_PIXEL_PACKED,245 .pixel_type = FF_PIXEL_PACKED,
246 .depth = 5,246 .depth = 5,
247 },247 },
248 [PIX_FMT_RGB444BE] = {248 [AV_PIX_FMT_RGB444BE] = {
249 .nb_channels = 3,249 .nb_channels = 3,
250 .color_type = FF_COLOR_RGB,250 .color_type = FF_COLOR_RGB,
251 .pixel_type = FF_PIXEL_PACKED,251 .pixel_type = FF_PIXEL_PACKED,
252 .depth = 4,252 .depth = 4,
253 },253 },
254 [PIX_FMT_RGB444LE] = {254 [AV_PIX_FMT_RGB444LE] = {
255 .nb_channels = 3,255 .nb_channels = 3,
256 .color_type = FF_COLOR_RGB,256 .color_type = FF_COLOR_RGB,
257 .pixel_type = FF_PIXEL_PACKED,257 .pixel_type = FF_PIXEL_PACKED,
@@ -259,31 +259,31 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { · 1 unmodified line
259 },259 },
260 260
261 /* gray / mono formats */261 /* gray / mono formats */
262 [PIX_FMT_GRAY16BE] = {262 [AV_PIX_FMT_GRAY16BE] = {
263 .nb_channels = 1,263 .nb_channels = 1,
264 .color_type = FF_COLOR_GRAY,264 .color_type = FF_COLOR_GRAY,
265 .pixel_type = FF_PIXEL_PLANAR,265 .pixel_type = FF_PIXEL_PLANAR,
266 .depth = 16,266 .depth = 16,
267 },267 },
268 [PIX_FMT_GRAY16LE] = {268 [AV_PIX_FMT_GRAY16LE] = {
269 .nb_channels = 1,269 .nb_channels = 1,
270 .color_type = FF_COLOR_GRAY,270 .color_type = FF_COLOR_GRAY,
271 .pixel_type = FF_PIXEL_PLANAR,271 .pixel_type = FF_PIXEL_PLANAR,
272 .depth = 16,272 .depth = 16,
273 },273 },
274 [PIX_FMT_GRAY8] = {274 [AV_PIX_FMT_GRAY8] = {
275 .nb_channels = 1,275 .nb_channels = 1,
276 .color_type = FF_COLOR_GRAY,276 .color_type = FF_COLOR_GRAY,
277 .pixel_type = FF_PIXEL_PLANAR,277 .pixel_type = FF_PIXEL_PLANAR,
278 .depth = 8,278 .depth = 8,
279 },279 },
280 [PIX_FMT_MONOWHITE] = {280 [AV_PIX_FMT_MONOWHITE] = {
281 .nb_channels = 1,281 .nb_channels = 1,
282 .color_type = FF_COLOR_GRAY,282 .color_type = FF_COLOR_GRAY,
283 .pixel_type = FF_PIXEL_PLANAR,283 .pixel_type = FF_PIXEL_PLANAR,
284 .depth = 1,284 .depth = 1,
285 },285 },
286 [PIX_FMT_MONOBLACK] = {286 [AV_PIX_FMT_MONOBLACK] = {
287 .nb_channels = 1,287 .nb_channels = 1,
288 .color_type = FF_COLOR_GRAY,288 .color_type = FF_COLOR_GRAY,
289 .pixel_type = FF_PIXEL_PLANAR,289 .pixel_type = FF_PIXEL_PLANAR,
@@ -291,116 +291,116 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { · 1 unmodified line
291 },291 },
292 292
293 /* paletted formats */293 /* paletted formats */
294 [PIX_FMT_PAL8] = {294 [AV_PIX_FMT_PAL8] = {
295 .nb_channels = 4, .is_alpha = 1,295 .nb_channels = 4, .is_alpha = 1,
296 .color_type = FF_COLOR_RGB,296 .color_type = FF_COLOR_RGB,
297 .pixel_type = FF_PIXEL_PALETTE,297 .pixel_type = FF_PIXEL_PALETTE,
298 .depth = 8,298 .depth = 8,
299 },299 },
300 [PIX_FMT_UYYVYY411] = {300 [AV_PIX_FMT_UYYVYY411] = {
301 .nb_channels = 1,301 .nb_channels = 1,
302 .color_type = FF_COLOR_YUV,302 .color_type = FF_COLOR_YUV,
303 .pixel_type = FF_PIXEL_PACKED,303 .pixel_type = FF_PIXEL_PACKED,
304 .depth = 8,304 .depth = 8,
305 },305 },
306 [PIX_FMT_ABGR] = {306 [AV_PIX_FMT_ABGR] = {
307 .nb_channels = 4, .is_alpha = 1,307 .nb_channels = 4, .is_alpha = 1,
308 .color_type = FF_COLOR_RGB,308 .color_type = FF_COLOR_RGB,
309 .pixel_type = FF_PIXEL_PACKED,309 .pixel_type = FF_PIXEL_PACKED,
310 .depth = 8,310 .depth = 8,
311 },311 },
312 [PIX_FMT_BGR565BE] = {312 [AV_PIX_FMT_BGR565BE] = {
313 .nb_channels = 3,313 .nb_channels = 3,
314 .color_type = FF_COLOR_RGB,314 .color_type = FF_COLOR_RGB,
315 .pixel_type = FF_PIXEL_PACKED,315 .pixel_type = FF_PIXEL_PACKED,
316 .depth = 5,316 .depth = 5,
317 },317 },
318 [PIX_FMT_BGR565LE] = {318 [AV_PIX_FMT_BGR565LE] = {
319 .nb_channels = 3,319 .nb_channels = 3,
320 .color_type = FF_COLOR_RGB,320 .color_type = FF_COLOR_RGB,
321 .pixel_type = FF_PIXEL_PACKED,321 .pixel_type = FF_PIXEL_PACKED,
322 .depth = 5,322 .depth = 5,
323 },323 },
324 [PIX_FMT_BGR555BE] = {324 [AV_PIX_FMT_BGR555BE] = {
325 .nb_channels = 3,325 .nb_channels = 3,
326 .color_type = FF_COLOR_RGB,326 .color_type = FF_COLOR_RGB,
327 .pixel_type = FF_PIXEL_PACKED,327 .pixel_type = FF_PIXEL_PACKED,
328 .depth = 5,328 .depth = 5,
329 },329 },
330 [PIX_FMT_BGR555LE] = {330 [AV_PIX_FMT_BGR555LE] = {
331 .nb_channels = 3,331 .nb_channels = 3,
332 .color_type = FF_COLOR_RGB,332 .color_type = FF_COLOR_RGB,
333 .pixel_type = FF_PIXEL_PACKED,333 .pixel_type = FF_PIXEL_PACKED,
334 .depth = 5,334 .depth = 5,
335 },335 },
336 [PIX_FMT_BGR444BE] = {336 [AV_PIX_FMT_BGR444BE] = {
337 .nb_channels = 3,337 .nb_channels = 3,
338 .color_type = FF_COLOR_RGB,338 .color_type = FF_COLOR_RGB,
339 .pixel_type = FF_PIXEL_PACKED,339 .pixel_type = FF_PIXEL_PACKED,
340 .depth = 4,340 .depth = 4,
341 },341 },
342 [PIX_FMT_BGR444LE] = {342 [AV_PIX_FMT_BGR444LE] = {
343 .nb_channels = 3,343 .nb_channels = 3,
344 .color_type = FF_COLOR_RGB,344 .color_type = FF_COLOR_RGB,
345 .pixel_type = FF_PIXEL_PACKED,345 .pixel_type = FF_PIXEL_PACKED,
346 .depth = 4,346 .depth = 4,
347 },347 },
348 [PIX_FMT_RGB8] = {348 [AV_PIX_FMT_RGB8] = {
349 .nb_channels = 1,349 .nb_channels = 1,
350 .color_type = FF_COLOR_RGB,350 .color_type = FF_COLOR_RGB,
351 .pixel_type = FF_PIXEL_PACKED,351 .pixel_type = FF_PIXEL_PACKED,
352 .depth = 8,352 .depth = 8,
353 },353 },
354 [PIX_FMT_RGB4] = {354 [AV_PIX_FMT_RGB4] = {
355 .nb_channels = 1,355 .nb_channels = 1,
356 .color_type = FF_COLOR_RGB,356 .color_type = FF_COLOR_RGB,
357 .pixel_type = FF_PIXEL_PACKED,357 .pixel_type = FF_PIXEL_PACKED,
358 .depth = 4,358 .depth = 4,
359 },359 },
360 [PIX_FMT_RGB4_BYTE] = {360 [AV_PIX_FMT_RGB4_BYTE] = {
361 .nb_channels = 1,361 .nb_channels = 1,
362 .color_type = FF_COLOR_RGB,362 .color_type = FF_COLOR_RGB,
363 .pixel_type = FF_PIXEL_PACKED,363 .pixel_type = FF_PIXEL_PACKED,
364 .depth = 8,364 .depth = 8,
365 },365 },
366 [PIX_FMT_BGR8] = {366 [AV_PIX_FMT_BGR8] = {
367 .nb_channels = 1,367 .nb_channels = 1,
368 .color_type = FF_COLOR_RGB,368 .color_type = FF_COLOR_RGB,
369 .pixel_type = FF_PIXEL_PACKED,369 .pixel_type = FF_PIXEL_PACKED,
370 .depth = 8,370 .depth = 8,
371 },371 },
372 [PIX_FMT_BGR4] = {372 [AV_PIX_FMT_BGR4] = {
373 .nb_channels = 1,373 .nb_channels = 1,
374 .color_type = FF_COLOR_RGB,374 .color_type = FF_COLOR_RGB,
375 .pixel_type = FF_PIXEL_PACKED,375 .pixel_type = FF_PIXEL_PACKED,
376 .depth = 4,376 .depth = 4,
377 },377 },
378 [PIX_FMT_BGR4_BYTE] = {378 [AV_PIX_FMT_BGR4_BYTE] = {
379 .nb_channels = 1,379 .nb_channels = 1,
380 .color_type = FF_COLOR_RGB,380 .color_type = FF_COLOR_RGB,
381 .pixel_type = FF_PIXEL_PACKED,381 .pixel_type = FF_PIXEL_PACKED,
382 .depth = 8,382 .depth = 8,
383 },383 },
384 [PIX_FMT_NV12] = {384 [AV_PIX_FMT_NV12] = {
385 .nb_channels = 2,385 .nb_channels = 2,
386 .color_type = FF_COLOR_YUV,386 .color_type = FF_COLOR_YUV,
387 .pixel_type = FF_PIXEL_PLANAR,387 .pixel_type = FF_PIXEL_PLANAR,
388 .depth = 8,388 .depth = 8,
389 },389 },
390 [PIX_FMT_NV21] = {390 [AV_PIX_FMT_NV21] = {
391 .nb_channels = 2,391 .nb_channels = 2,
392 .color_type = FF_COLOR_YUV,392 .color_type = FF_COLOR_YUV,
393 .pixel_type = FF_PIXEL_PLANAR,393 .pixel_type = FF_PIXEL_PLANAR,
394 .depth = 8,394 .depth = 8,
395 },395 },
396 396
397 [PIX_FMT_BGRA] = {397 [AV_PIX_FMT_BGRA] = {
398 .nb_channels = 4, .is_alpha = 1,398 .nb_channels = 4, .is_alpha = 1,
399 .color_type = FF_COLOR_RGB,399 .color_type = FF_COLOR_RGB,
400 .pixel_type = FF_PIXEL_PACKED,400 .pixel_type = FF_PIXEL_PACKED,
401 .depth = 8,401 .depth = 8,
402 },402 },
403 [PIX_FMT_RGBA] = {403 [AV_PIX_FMT_RGBA] = {
404 .nb_channels = 4, .is_alpha = 1,404 .nb_channels = 4, .is_alpha = 1,
405 .color_type = FF_COLOR_RGB,405 .color_type = FF_COLOR_RGB,
406 .pixel_type = FF_PIXEL_PACKED,406 .pixel_type = FF_PIXEL_PACKED,
@@ -408,19 +408,19 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { · 1 unmodified line
408 },408 },
409};409};
410 410
411void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift)411void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
412{412{
413 *h_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w;413 *h_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w;
414 *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;414 *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
415}415}
416 416
417int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt)417int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt)
418{418{
419 return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL;419 return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL;
420}420}
421 421
422int avpicture_fill(AVPicture *picture, uint8_t *ptr,422int avpicture_fill(AVPicture *picture, uint8_t *ptr,
423 enum PixelFormat pix_fmt, int width, int height)423 enum AVPixelFormat pix_fmt, int width, int height)
424{424{
425 int ret;425 int ret;
426 426
@@ -433,7 +433,7 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr, · 6 unmodified lines
433 return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);433 return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
434}434}
435 435
436int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,436int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt, int width, int height,
437 unsigned char *dest, int dest_size)437 unsigned char *dest, int dest_size)
438{438{
439 int i, j, nb_planes = 0, linesizes[4];439 int i, j, nb_planes = 0, linesizes[4];
@@ -466,7 +466,7 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, · 26 unmodified lines
466 return size;466 return size;
467}467}
468 468
469int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height)469int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
470{470{
471 AVPicture dummy_pict;471 AVPicture dummy_pict;
472 if(av_image_check_size(width, height, 0, NULL))472 if(av_image_check_size(width, height, 0, NULL))
@@ -477,7 +477,7 @@ int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height) · 4 unmodified lines
477 return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);477 return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);
478}478}
479 479
480int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,480int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
481 int has_alpha)481 int has_alpha)
482{482{
483 const PixFmtInfo *pf, *ps;483 const PixFmtInfo *pf, *ps;
@@ -491,10 +491,10 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 7 unmodified lines
491 loss = 0;491 loss = 0;
492 pf = &pix_fmt_info[dst_pix_fmt];492 pf = &pix_fmt_info[dst_pix_fmt];
493 if (pf->depth < ps->depth ||493 if (pf->depth < ps->depth ||
494 ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE ||494 ((dst_pix_fmt == AV_PIX_FMT_RGB555BE || dst_pix_fmt == AV_PIX_FMT_RGB555LE ||
495 dst_pix_fmt == PIX_FMT_BGR555BE || dst_pix_fmt == PIX_FMT_BGR555LE) &&495 dst_pix_fmt == AV_PIX_FMT_BGR555BE || dst_pix_fmt == AV_PIX_FMT_BGR555LE) &&
496 (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE ||496 (src_pix_fmt == AV_PIX_FMT_RGB565BE || src_pix_fmt == AV_PIX_FMT_RGB565LE ||
497 src_pix_fmt == PIX_FMT_BGR565BE || src_pix_fmt == PIX_FMT_BGR565LE)))497 src_pix_fmt == AV_PIX_FMT_BGR565BE || src_pix_fmt == AV_PIX_FMT_BGR565LE)))
498 loss |= FF_LOSS_DEPTH;498 loss |= FF_LOSS_DEPTH;
499 if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||499 if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
500 dst_desc->log2_chroma_h > src_desc->log2_chroma_h)500 dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
@@ -536,7 +536,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 35 unmodified lines
536 return loss;536 return loss;
537}537}
538 538
539static int avg_bits_per_pixel(enum PixelFormat pix_fmt)539static int avg_bits_per_pixel(enum AVPixelFormat pix_fmt)
540{540{
541 int bits;541 int bits;
542 const PixFmtInfo *pf;542 const PixFmtInfo *pf;
@@ -546,23 +546,23 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt) · 3 unmodified lines
546 switch(pf->pixel_type) {546 switch(pf->pixel_type) {
547 case FF_PIXEL_PACKED:547 case FF_PIXEL_PACKED:
548 switch(pix_fmt) {548 switch(pix_fmt) {
549 case PIX_FMT_YUYV422:549 case AV_PIX_FMT_YUYV422:
550 case PIX_FMT_UYVY422:550 case AV_PIX_FMT_UYVY422:
551 case PIX_FMT_RGB565BE:551 case AV_PIX_FMT_RGB565BE:
552 case PIX_FMT_RGB565LE:552 case AV_PIX_FMT_RGB565LE:
553 case PIX_FMT_RGB555BE:553 case AV_PIX_FMT_RGB555BE:
554 case PIX_FMT_RGB555LE:554 case AV_PIX_FMT_RGB555LE:
555 case PIX_FMT_RGB444BE:555 case AV_PIX_FMT_RGB444BE:
556 case PIX_FMT_RGB444LE:556 case AV_PIX_FMT_RGB444LE:
557 case PIX_FMT_BGR565BE:557 case AV_PIX_FMT_BGR565BE:
558 case PIX_FMT_BGR565LE:558 case AV_PIX_FMT_BGR565LE:
559 case PIX_FMT_BGR555BE:559 case AV_PIX_FMT_BGR555BE:
560 case PIX_FMT_BGR555LE:560 case AV_PIX_FMT_BGR555LE:
561 case PIX_FMT_BGR444BE:561 case AV_PIX_FMT_BGR444BE:
562 case PIX_FMT_BGR444LE:562 case AV_PIX_FMT_BGR444LE:
563 bits = 16;563 bits = 16;
564 break;564 break;
565 case PIX_FMT_UYYVYY411:565 case AV_PIX_FMT_UYYVYY411:
566 bits = 12;566 bits = 12;
567 break;567 break;
568 default:568 default:
@@ -588,25 +588,25 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt) · 19 unmodified lines
588 return bits;588 return bits;
589}589}
590 590
591static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list,591static enum AVPixelFormat avcodec_find_best_pix_fmt1(enum AVPixelFormat *pix_fmt_list,
592 enum PixelFormat src_pix_fmt,592 enum AVPixelFormat src_pix_fmt,
593 int has_alpha,593 int has_alpha,
594 int loss_mask)594 int loss_mask)
595{595{
596 int dist, i, loss, min_dist;596 int dist, i, loss, min_dist;
597 enum PixelFormat dst_pix_fmt;597 enum AVPixelFormat dst_pix_fmt;
598 598
599 /* find exact color match with smallest size */599 /* find exact color match with smallest size */
600 dst_pix_fmt = PIX_FMT_NONE;600 dst_pix_fmt = AV_PIX_FMT_NONE;
601 min_dist = 0x7fffffff;601 min_dist = 0x7fffffff;
602 i = 0;602 i = 0;
603 while (pix_fmt_list[i] != PIX_FMT_NONE) {603 while (pix_fmt_list[i] != AV_PIX_FMT_NONE) {
604 enum PixelFormat pix_fmt = pix_fmt_list[i];604 enum AVPixelFormat pix_fmt = pix_fmt_list[i];
605 605
606 if (i > PIX_FMT_NB) {606 if (i > AV_PIX_FMT_NB) {
607 av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "607 av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "
608 "it is either not properly terminated or contains duplicates\n");608 "it is either not properly terminated or contains duplicates\n");
609 return PIX_FMT_NONE;609 return AV_PIX_FMT_NONE;
610 }610 }
611 611
612 loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;612 loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;
@@ -623,10 +623,10 @@ static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_lis · 10 unmodified lines
623}623}
624 624
625#if FF_API_FIND_BEST_PIX_FMT625#if FF_API_FIND_BEST_PIX_FMT
626enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,626enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
627 int has_alpha, int *loss_ptr)627 int has_alpha, int *loss_ptr)
628{628{
629 enum PixelFormat list[64];629 enum AVPixelFormat list[64];
630 int i, j = 0;630 int i, j = 0;
631 631
632 // test only the first 64 pixel formats to avoid undefined behaviour632 // test only the first 64 pixel formats to avoid undefined behaviour
@@ -634,17 +634,17 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma · 1 unmodified line
634 if (pix_fmt_mask & (1ULL << i))634 if (pix_fmt_mask & (1ULL << i))
635 list[j++] = i;635 list[j++] = i;
636 }636 }
637 list[j] = PIX_FMT_NONE;637 list[j] = AV_PIX_FMT_NONE;
638 638
639 return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);639 return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);
640}640}
641#endif /* FF_API_FIND_BEST_PIX_FMT */641#endif /* FF_API_FIND_BEST_PIX_FMT */
642 642
643enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,643enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
644 enum PixelFormat src_pix_fmt,644 enum AVPixelFormat src_pix_fmt,
645 int has_alpha, int *loss_ptr)645 int has_alpha, int *loss_ptr)
646{646{
647 enum PixelFormat dst_pix_fmt;647 enum AVPixelFormat dst_pix_fmt;
648 int loss_mask, i;648 int loss_mask, i;
649 static const int loss_mask_order[] = {649 static const int loss_mask_order[] = {
650 ~0, /* no loss first */650 ~0, /* no loss first */
@@ -667,7 +667,7 @@ enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list, · 16 unmodified lines
667 if (loss_mask == 0)667 if (loss_mask == 0)
668 break;668 break;
669 }669 }
670 return PIX_FMT_NONE;670 return AV_PIX_FMT_NONE;
671 found:671 found:
672 if (loss_ptr)672 if (loss_ptr)
673 *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);673 *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
@@ -675,7 +675,7 @@ enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list, · 1 unmodified line
675}675}
676 676
677void av_picture_copy(AVPicture *dst, const AVPicture *src,677void av_picture_copy(AVPicture *dst, const AVPicture *src,
678 enum PixelFormat pix_fmt, int width, int height)678 enum AVPixelFormat pix_fmt, int width, int height)
679{679{
680 av_image_copy(dst->data, dst->linesize, src->data,680 av_image_copy(dst->data, dst->linesize, src->data,
681 src->linesize, pix_fmt, width, height);681 src->linesize, pix_fmt, width, height);
@@ -769,7 +769,7 @@ void ff_shrink88(uint8_t *dst, int dst_wrap, · 87 unmodified lines
769 769
770 770
771int avpicture_alloc(AVPicture *picture,771int avpicture_alloc(AVPicture *picture,
772 enum PixelFormat pix_fmt, int width, int height)772 enum AVPixelFormat pix_fmt, int width, int height)
773{773{
774 int ret;774 int ret;
775 775
@@ -795,12 +795,12 @@ static inline int is_yuv_planar(const PixFmtInfo *ps) · 19 unmodified lines
795}795}
796 796
797int av_picture_crop(AVPicture *dst, const AVPicture *src,797int av_picture_crop(AVPicture *dst, const AVPicture *src,
798 enum PixelFormat pix_fmt, int top_band, int left_band)798 enum AVPixelFormat pix_fmt, int top_band, int left_band)
799{799{
800 int y_shift;800 int y_shift;
801 int x_shift;801 int x_shift;
802 802
803 if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt]))803 if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt]))
804 return -1;804 return -1;
805 805
806 y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;806 y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
@@ -817,7 +817,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src, · 10 unmodified lines
817}817}
818 818
819int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,819int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
820 enum PixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright,820 enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright,
821 int *color)821 int *color)
822{822{
823 uint8_t *optr;823 uint8_t *optr;
@@ -826,7 +826,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, · 2 unmodified lines
826 int yheight;826 int yheight;
827 int i, y;827 int i, y;
828 828
829 if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB ||829 if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB ||
830 !is_yuv_planar(&pix_fmt_info[pix_fmt])) return -1;830 !is_yuv_planar(&pix_fmt_info[pix_fmt])) return -1;
831 831
832 for (i = 0; i < 3; i++) {832 for (i = 0; i < 3; i++) {
@@ -985,17 +985,17 @@ static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, · 152 unmodified lines
985}985}
986 986
987int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,987int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
988 enum PixelFormat pix_fmt, int width, int height)988 enum AVPixelFormat pix_fmt, int width, int height)
989{989{
990 int i;990 int i;
991 991
992 if (pix_fmt != PIX_FMT_YUV420P &&992 if (pix_fmt != AV_PIX_FMT_YUV420P &&
993 pix_fmt != PIX_FMT_YUVJ420P &&993 pix_fmt != AV_PIX_FMT_YUVJ420P &&
994 pix_fmt != PIX_FMT_YUV422P &&994 pix_fmt != AV_PIX_FMT_YUV422P &&
995 pix_fmt != PIX_FMT_YUVJ422P &&995 pix_fmt != AV_PIX_FMT_YUVJ422P &&
996 pix_fmt != PIX_FMT_YUV444P &&996 pix_fmt != AV_PIX_FMT_YUV444P &&
997 pix_fmt != PIX_FMT_YUV411P &&997 pix_fmt != AV_PIX_FMT_YUV411P &&
998 pix_fmt != PIX_FMT_GRAY8)998 pix_fmt != AV_PIX_FMT_GRAY8)
999 return -1;999 return -1;
1000 if ((width & 3) != 0 || (height & 3) != 0)1000 if ((width & 3) != 0 || (height & 3) != 0)
1001 return -1;1001 return -1;
@@ -1003,22 +1003,22 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, · 1 unmodified line
1003 for(i=0;i<3;i++) {1003 for(i=0;i<3;i++) {
1004 if (i == 1) {1004 if (i == 1) {
1005 switch(pix_fmt) {1005 switch(pix_fmt) {
1006 case PIX_FMT_YUVJ420P:1006 case AV_PIX_FMT_YUVJ420P:
1007 case PIX_FMT_YUV420P:1007 case AV_PIX_FMT_YUV420P:
1008 width >>= 1;1008 width >>= 1;
1009 height >>= 1;1009 height >>= 1;
1010 break;1010 break;
1011 case PIX_FMT_YUV422P:1011 case AV_PIX_FMT_YUV422P:
1012 case PIX_FMT_YUVJ422P:1012 case AV_PIX_FMT_YUVJ422P:
1013 width >>= 1;1013 width >>= 1;
1014 break;1014 break;
1015 case PIX_FMT_YUV411P:1015 case AV_PIX_FMT_YUV411P:
1016 width >>= 2;1016 width >>= 2;
1017 break;1017 break;
1018 default:1018 default:
1019 break;1019 break;
1020 }1020 }
1021 if (pix_fmt == PIX_FMT_GRAY8) {1021 if (pix_fmt == AV_PIX_FMT_GRAY8) {
1022 break;1022 break;
1023 }1023 }
1024 }1024 }
libavcodec/indeo2.c+1−1
@@ -203,7 +203,7 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx){ · 202 unmodified lines
203 203
204 ic->avctx = avctx;204 ic->avctx = avctx;
205 205
206 avctx->pix_fmt= PIX_FMT_YUV410P;206 avctx->pix_fmt= AV_PIX_FMT_YUV410P;
207 207
208 ir2_vlc.table = vlc_tables;208 ir2_vlc.table = vlc_tables;
209 ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;209 ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
libavcodec/indeo3.c+1−1
@@ -1009,7 +1009,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 1008 unmodified lines
1009 ctx->avctx = avctx;1009 ctx->avctx = avctx;
1010 ctx->width = avctx->width;1010 ctx->width = avctx->width;
1011 ctx->height = avctx->height;1011 ctx->height = avctx->height;
1012 avctx->pix_fmt = PIX_FMT_YUV410P;1012 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
1013 1013
1014 build_requant_tab();1014 build_requant_tab();
1015 1015
libavcodec/indeo4.c+1−1
@@ -586,7 +586,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 585 unmodified lines
586 ctx->pic_conf.pic_width = 0;586 ctx->pic_conf.pic_width = 0;
587 ctx->pic_conf.pic_height = 0;587 ctx->pic_conf.pic_height = 0;
588 588
589 avctx->pix_fmt = PIX_FMT_YUV410P;589 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
590 590
591 ctx->decode_pic_hdr = decode_pic_hdr;591 ctx->decode_pic_hdr = decode_pic_hdr;
592 ctx->decode_band_hdr = decode_band_hdr;592 ctx->decode_band_hdr = decode_band_hdr;
libavcodec/indeo5.c+1−1
@@ -627,7 +627,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 626 unmodified lines
627 ctx->switch_buffers = switch_buffers;627 ctx->switch_buffers = switch_buffers;
628 ctx->is_nonnull_frame = is_nonnull_frame;628 ctx->is_nonnull_frame = is_nonnull_frame;
629 629
630 avctx->pix_fmt = PIX_FMT_YUV410P;630 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
631 631
632 return 0;632 return 0;
633}633}
libavcodec/internal.h+3−3
@@ -36,7 +36,7 @@ typedef struct InternalBuffer { · 35 unmodified lines
36 int linesize[AV_NUM_DATA_POINTERS];36 int linesize[AV_NUM_DATA_POINTERS];
37 int width;37 int width;
38 int height;38 int height;
39 enum PixelFormat pix_fmt;39 enum AVPixelFormat pix_fmt;
40 uint8_t **extended_data;40 uint8_t **extended_data;
41 int audio_data_size;41 int audio_data_size;
42 int nb_channels;42 int nb_channels;
@@ -86,7 +86,7 @@ struct AVCodecDefault { · 43 unmodified lines
86/**86/**
87 * Determine whether pix_fmt is a hardware accelerated format.87 * Determine whether pix_fmt is a hardware accelerated format.
88 */88 */
89int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt);89int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt);
90 90
91/**91/**
92 * Return the hardware accelerated codec for codec codec_id and92 * Return the hardware accelerated codec for codec codec_id and
@@ -96,7 +96,7 @@ int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt); · 3 unmodified lines
96 * @param pix_fmt the pixel format to match96 * @param pix_fmt the pixel format to match
97 * @return the hardware accelerated codec, or NULL if none was found.97 * @return the hardware accelerated codec, or NULL if none was found.
98 */98 */
99AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum PixelFormat pix_fmt);99AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt);
100 100
101/**101/**
102 * Return the index into tab at which {a,b} match elements {[0],[1]} of tab.102 * Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
libavcodec/interplayvideo.c+1−1
@@ -941,7 +941,7 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) · 940 unmodified lines
941 s->avctx = avctx;941 s->avctx = avctx;
942 942
943 s->is_16bpp = avctx->bits_per_coded_sample == 16;943 s->is_16bpp = avctx->bits_per_coded_sample == 16;
944 avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8;944 avctx->pix_fmt = s->is_16bpp ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_PAL8;
945 945
946 ff_dsputil_init(&s->dsp, avctx);946 ff_dsputil_init(&s->dsp, avctx);
947 947
libavcodec/jpeglsenc.c+11−11
@@ -244,7 +244,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 243 unmodified lines
244 p->pict_type= AV_PICTURE_TYPE_I;244 p->pict_type= AV_PICTURE_TYPE_I;
245 p->key_frame= 1;245 p->key_frame= 1;
246 246
247 if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16)247 if(avctx->pix_fmt == AV_PIX_FMT_GRAY8 || avctx->pix_fmt == AV_PIX_FMT_GRAY16)
248 comps = 1;248 comps = 1;
249 else249 else
250 comps = 3;250 comps = 3;
@@ -264,7 +264,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 13 unmodified lines
264 put_marker(&pb, SOI);264 put_marker(&pb, SOI);
265 put_marker(&pb, SOF48);265 put_marker(&pb, SOF48);
266 put_bits(&pb, 16, 8 + comps * 3); // header size depends on components266 put_bits(&pb, 16, 8 + comps * 3); // header size depends on components
267 put_bits(&pb, 8, (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8); // bpp267 put_bits(&pb, 8, (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8); // bpp
268 put_bits(&pb, 16, avctx->height);268 put_bits(&pb, 16, avctx->height);
269 put_bits(&pb, 16, avctx->width);269 put_bits(&pb, 16, avctx->width);
270 put_bits(&pb, 8, comps); // components270 put_bits(&pb, 8, comps); // components
@@ -288,7 +288,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 17 unmodified lines
288 state = av_mallocz(sizeof(JLSState));288 state = av_mallocz(sizeof(JLSState));
289 /* initialize JPEG-LS state from JPEG parameters */289 /* initialize JPEG-LS state from JPEG parameters */
290 state->near = near;290 state->near = near;
291 state->bpp = (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8;291 state->bpp = (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8;
292 ff_jpegls_reset_coding_parameters(state, 0);292 ff_jpegls_reset_coding_parameters(state, 0);
293 ff_jpegls_init_state(state);293 ff_jpegls_init_state(state);
294 294
@@ -297,7 +297,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 2 unmodified lines
297 zero = av_mallocz(p->linesize[0]);297 zero = av_mallocz(p->linesize[0]);
298 last = zero;298 last = zero;
299 cur = p->data[0];299 cur = p->data[0];
300 if(avctx->pix_fmt == PIX_FMT_GRAY8){300 if(avctx->pix_fmt == AV_PIX_FMT_GRAY8){
301 int t = 0;301 int t = 0;
302 302
303 for(i = 0; i < avctx->height; i++) {303 for(i = 0; i < avctx->height; i++) {
@@ -306,7 +306,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 2 unmodified lines
306 last = cur;306 last = cur;
307 cur += p->linesize[0];307 cur += p->linesize[0];
308 }308 }
309 }else if(avctx->pix_fmt == PIX_FMT_GRAY16){309 }else if(avctx->pix_fmt == AV_PIX_FMT_GRAY16){
310 int t = 0;310 int t = 0;
311 311
312 for(i = 0; i < avctx->height; i++) {312 for(i = 0; i < avctx->height; i++) {
@@ -315,7 +315,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 2 unmodified lines
315 last = cur;315 last = cur;
316 cur += p->linesize[0];316 cur += p->linesize[0];
317 }317 }
318 }else if(avctx->pix_fmt == PIX_FMT_RGB24){318 }else if(avctx->pix_fmt == AV_PIX_FMT_RGB24){
319 int j, width;319 int j, width;
320 int Rc[3] = {0, 0, 0};320 int Rc[3] = {0, 0, 0};
321 321
@@ -328,7 +328,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, · 6 unmodified lines
328 last = cur;328 last = cur;
329 cur += s->picture.linesize[0];329 cur += s->picture.linesize[0];
330 }330 }
331 }else if(avctx->pix_fmt == PIX_FMT_BGR24){331 }else if(avctx->pix_fmt == AV_PIX_FMT_BGR24){
332 int j, width;332 int j, width;
333 int Rc[3] = {0, 0, 0};333 int Rc[3] = {0, 0, 0};
334 334
@@ -385,7 +385,7 @@ static av_cold int encode_init_ls(AVCodecContext *ctx) { · 50 unmodified lines
385 c->avctx = ctx;385 c->avctx = ctx;
386 ctx->coded_frame = &c->picture;386 ctx->coded_frame = &c->picture;
387 387
388 if(ctx->pix_fmt != PIX_FMT_GRAY8 && ctx->pix_fmt != PIX_FMT_GRAY16 && ctx->pix_fmt != PIX_FMT_RGB24 && ctx->pix_fmt != PIX_FMT_BGR24){388 if(ctx->pix_fmt != AV_PIX_FMT_GRAY8 && ctx->pix_fmt != AV_PIX_FMT_GRAY16 && ctx->pix_fmt != AV_PIX_FMT_RGB24 && ctx->pix_fmt != AV_PIX_FMT_BGR24){
389 av_log(ctx, AV_LOG_ERROR, "Only grayscale and RGB24/BGR24 images are supported\n");389 av_log(ctx, AV_LOG_ERROR, "Only grayscale and RGB24/BGR24 images are supported\n");
390 return -1;390 return -1;
391 }391 }
@@ -399,9 +399,9 @@ AVCodec ff_jpegls_encoder = { //FIXME avoid MPV_* lossless JPEG should not need · 7 unmodified lines
399 .priv_data_size = sizeof(JpeglsContext),399 .priv_data_size = sizeof(JpeglsContext),
400 .init = encode_init_ls,400 .init = encode_init_ls,
401 .encode2 = encode_picture_ls,401 .encode2 = encode_picture_ls,
402 .pix_fmts = (const enum PixelFormat[]){402 .pix_fmts = (const enum AVPixelFormat[]){
403 PIX_FMT_BGR24, PIX_FMT_RGB24, PIX_FMT_GRAY8, PIX_FMT_GRAY16,403 AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
404 PIX_FMT_NONE404 AV_PIX_FMT_NONE
405 },405 },
406 .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),406 .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
407};407};
libavcodec/jvdec.c+1−1
@@ -40,7 +40,7 @@ typedef struct JvContext { · 39 unmodified lines
40static av_cold int decode_init(AVCodecContext *avctx)40static av_cold int decode_init(AVCodecContext *avctx)
41{41{
42 JvContext *s = avctx->priv_data;42 JvContext *s = avctx->priv_data;
43 avctx->pix_fmt = PIX_FMT_PAL8;43 avctx->pix_fmt = AV_PIX_FMT_PAL8;
44 ff_dsputil_init(&s->dsp, avctx);44 ff_dsputil_init(&s->dsp, avctx);
45 return 0;45 return 0;
46}46}
libavcodec/kgv1dec.c+1−1
@@ -169,7 +169,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 168 unmodified lines
169 KgvContext * const c = avctx->priv_data;169 KgvContext * const c = avctx->priv_data;
170 170
171 c->avctx = avctx;171 c->avctx = avctx;
172 avctx->pix_fmt = PIX_FMT_RGB555;172 avctx->pix_fmt = AV_PIX_FMT_RGB555;
173 avctx->flags |= CODEC_FLAG_EMU_EDGE;173 avctx->flags |= CODEC_FLAG_EMU_EDGE;
174 174
175 return 0;175 return 0;
libavcodec/kmvc.c+1−1
@@ -397,7 +397,7 @@ static av_cold int decode_init(AVCodecContext * avctx) · 396 unmodified lines
397 c->setpal = 1;397 c->setpal = 1;
398 }398 }
399 399
400 avctx->pix_fmt = PIX_FMT_PAL8;400 avctx->pix_fmt = AV_PIX_FMT_PAL8;
401 401
402 return 0;402 return 0;
403}403}
libavcodec/lagarith.c+7−7
@@ -259,7 +259,7 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf, · 258 unmodified lines
259 if (line == 1) {259 if (line == 1) {
260 /* Second line, left predict first pixel, the rest of the line is median predicted260 /* Second line, left predict first pixel, the rest of the line is median predicted
261 * NOTE: In the case of RGB this pixel is top predicted */261 * NOTE: In the case of RGB this pixel is top predicted */
262 TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;262 TL = l->avctx->pix_fmt == AV_PIX_FMT_YUV420P ? buf[-stride] : L;
263 } else {263 } else {
264 /* Top left is 2 rows back, last pixel */264 /* Top left is 2 rows back, last pixel */
265 TL = buf[width - (2 * stride) - 1];265 TL = buf[width - (2 * stride) - 1];
@@ -472,7 +472,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, · 206 unmodified lines
472 return -1;472 return -1;
473 }473 }
474 474
475 if (l->avctx->pix_fmt != PIX_FMT_YUV422P) {475 if (l->avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
476 for (i = 0; i < height; i++) {476 for (i = 0; i < height; i++) {
477 lag_pred_line(l, dst, width, stride, i);477 lag_pred_line(l, dst, width, stride, i);
478 dst += stride;478 dst += stride;
@@ -524,7 +524,7 @@ static int lag_decode_frame(AVCodecContext *avctx, · 45 unmodified lines
524 524
525 switch (frametype) {525 switch (frametype) {
526 case FRAME_SOLID_RGBA:526 case FRAME_SOLID_RGBA:
527 avctx->pix_fmt = PIX_FMT_RGB32;527 avctx->pix_fmt = AV_PIX_FMT_RGB32;
528 528
529 if (ff_thread_get_buffer(avctx, p) < 0) {529 if (ff_thread_get_buffer(avctx, p) < 0) {
530 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");530 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@@ -539,14 +539,14 @@ static int lag_decode_frame(AVCodecContext *avctx, · 8 unmodified lines
539 }539 }
540 break;540 break;
541 case FRAME_ARITH_RGBA:541 case FRAME_ARITH_RGBA:
542 avctx->pix_fmt = PIX_FMT_RGB32;542 avctx->pix_fmt = AV_PIX_FMT_RGB32;
543 planes = 4;543 planes = 4;
544 offset_ry += 4;544 offset_ry += 4;
545 offs[3] = AV_RL32(buf + 9);545 offs[3] = AV_RL32(buf + 9);
546 case FRAME_ARITH_RGB24:546 case FRAME_ARITH_RGB24:
547 case FRAME_U_RGB24:547 case FRAME_U_RGB24:
548 if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24)548 if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24)
549 avctx->pix_fmt = PIX_FMT_RGB24;549 avctx->pix_fmt = AV_PIX_FMT_RGB24;
550 550
551 if (ff_thread_get_buffer(avctx, p) < 0) {551 if (ff_thread_get_buffer(avctx, p) < 0) {
552 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");552 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@@ -606,7 +606,7 @@ static int lag_decode_frame(AVCodecContext *avctx, · 53 unmodified lines
606 }606 }
607 break;607 break;
608 case FRAME_ARITH_YUY2:608 case FRAME_ARITH_YUY2:
609 avctx->pix_fmt = PIX_FMT_YUV422P;609 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
610 610
611 if (ff_thread_get_buffer(avctx, p) < 0) {611 if (ff_thread_get_buffer(avctx, p) < 0) {
612 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");612 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@@ -632,7 +632,7 @@ static int lag_decode_frame(AVCodecContext *avctx, · 19 unmodified lines
632 buf + offset_bv, buf_size - offset_bv);632 buf + offset_bv, buf_size - offset_bv);
633 break;633 break;
634 case FRAME_ARITH_YV12:634 case FRAME_ARITH_YV12:
635 avctx->pix_fmt = PIX_FMT_YUV420P;635 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
636 636
637 if (ff_thread_get_buffer(avctx, p) < 0) {637 if (ff_thread_get_buffer(avctx, p) < 0) {
638 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");638 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
libavcodec/lcldec.c+6−6
@@ -495,37 +495,37 @@ static av_cold int decode_init(AVCodecContext *avctx) · 494 unmodified lines
495 case IMGTYPE_YUV111:495 case IMGTYPE_YUV111:
496 c->decomp_size = basesize * 3;496 c->decomp_size = basesize * 3;
497 max_decomp_size = max_basesize * 3;497 max_decomp_size = max_basesize * 3;
498 avctx->pix_fmt = PIX_FMT_YUV444P;498 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
499 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 1:1:1.\n");499 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 1:1:1.\n");
500 break;500 break;
501 case IMGTYPE_YUV422:501 case IMGTYPE_YUV422:
502 c->decomp_size = basesize * 2;502 c->decomp_size = basesize * 2;
503 max_decomp_size = max_basesize * 2;503 max_decomp_size = max_basesize * 2;
504 avctx->pix_fmt = PIX_FMT_YUV422P;504 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
505 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");505 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");
506 break;506 break;
507 case IMGTYPE_RGB24:507 case IMGTYPE_RGB24:
508 c->decomp_size = basesize * 3;508 c->decomp_size = basesize * 3;
509 max_decomp_size = max_basesize * 3;509 max_decomp_size = max_basesize * 3;
510 avctx->pix_fmt = PIX_FMT_BGR24;510 avctx->pix_fmt = AV_PIX_FMT_BGR24;
511 av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n");511 av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n");
512 break;512 break;
513 case IMGTYPE_YUV411:513 case IMGTYPE_YUV411:
514 c->decomp_size = basesize / 2 * 3;514 c->decomp_size = basesize / 2 * 3;
515 max_decomp_size = max_basesize / 2 * 3;515 max_decomp_size = max_basesize / 2 * 3;
516 avctx->pix_fmt = PIX_FMT_YUV411P;516 avctx->pix_fmt = AV_PIX_FMT_YUV411P;
517 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:1:1.\n");517 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:1:1.\n");
518 break;518 break;
519 case IMGTYPE_YUV211:519 case IMGTYPE_YUV211:
520 c->decomp_size = basesize * 2;520 c->decomp_size = basesize * 2;
521 max_decomp_size = max_basesize * 2;521 max_decomp_size = max_basesize * 2;
522 avctx->pix_fmt = PIX_FMT_YUV422P;522 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
523 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 2:1:1.\n");523 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 2:1:1.\n");
524 break;524 break;
525 case IMGTYPE_YUV420:525 case IMGTYPE_YUV420:
526 c->decomp_size = basesize / 2 * 3;526 c->decomp_size = basesize / 2 * 3;
527 max_decomp_size = max_basesize / 2 * 3;527 max_decomp_size = max_basesize / 2 * 3;
528 avctx->pix_fmt = PIX_FMT_YUV420P;528 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
529 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:0.\n");529 av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:0.\n");
530 break;530 break;
531 default:531 default:
libavcodec/lclenc.c+2−2
@@ -89,7 +89,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 88 unmodified lines
89 p->pict_type= AV_PICTURE_TYPE_I;89 p->pict_type= AV_PICTURE_TYPE_I;
90 p->key_frame= 1;90 p->key_frame= 1;
91 91
92 if(avctx->pix_fmt != PIX_FMT_BGR24){92 if(avctx->pix_fmt != AV_PIX_FMT_BGR24){
93 av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");93 av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
94 return -1;94 return -1;
95 }95 }
@@ -192,6 +192,6 @@ AVCodec ff_zlib_encoder = { · 96 unmodified lines
192 .init = encode_init,192 .init = encode_init,
193 .encode2 = encode_frame,193 .encode2 = encode_frame,
194 .close = encode_end,194 .close = encode_end,
195 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_BGR24, PIX_FMT_NONE },195 .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
196 .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),196 .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
197};197};
libavcodec/libopenjpegdec.c+31−31
@@ -40,27 +40,27 @@ · 39 unmodified lines
40 40
41// pix_fmts with lower bpp have to be listed before41// pix_fmts with lower bpp have to be listed before
42// similar pix_fmts with higher bpp.42// similar pix_fmts with higher bpp.
43#define RGB_PIXEL_FORMATS PIX_FMT_RGB24, PIX_FMT_RGBA, \43#define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, \
44 PIX_FMT_RGB4844 AV_PIX_FMT_RGB48
45 45
46#define GRAY_PIXEL_FORMATS PIX_FMT_GRAY8, PIX_FMT_Y400A, \46#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_Y400A, \
47 PIX_FMT_GRAY1647 AV_PIX_FMT_GRAY16
48 48
49#define YUV_PIXEL_FORMATS PIX_FMT_YUV410P, PIX_FMT_YUV411P, \49#define YUV_PIXEL_FORMATS AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, \
50 PIX_FMT_YUVA420P, \50 AV_PIX_FMT_YUVA420P, \
51 PIX_FMT_YUV420P, PIX_FMT_YUV422P, \51 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, \
52 PIX_FMT_YUV440P, PIX_FMT_YUV444P, \52 AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, \
53 PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, \53 AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, \
54 PIX_FMT_YUV444P9, \54 AV_PIX_FMT_YUV444P9, \
55 PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, \55 AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, \
56 PIX_FMT_YUV444P10, \56 AV_PIX_FMT_YUV444P10, \
57 PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, \57 AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, \
58 PIX_FMT_YUV444P1658 AV_PIX_FMT_YUV444P16
59 59
60static const enum PixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS};60static const enum AVPixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS};
61static const enum PixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};61static const enum AVPixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};
62static const enum PixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS};62static const enum AVPixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS};
63static const enum PixelFormat any_pix_fmts[] = {RGB_PIXEL_FORMATS,63static const enum AVPixelFormat any_pix_fmts[] = {RGB_PIXEL_FORMATS,
64 GRAY_PIXEL_FORMATS,64 GRAY_PIXEL_FORMATS,
65 YUV_PIXEL_FORMATS};65 YUV_PIXEL_FORMATS};
66 66
@@ -73,7 +73,7 @@ typedef struct { · 6 unmodified lines
73} LibOpenJPEGContext;73} LibOpenJPEGContext;
74 74
75static int libopenjpeg_matches_pix_fmt(const opj_image_t *img,75static int libopenjpeg_matches_pix_fmt(const opj_image_t *img,
76 enum PixelFormat pix_fmt)76 enum AVPixelFormat pix_fmt)
77{77{
78 AVPixFmtDescriptor des = av_pix_fmt_descriptors[pix_fmt];78 AVPixFmtDescriptor des = av_pix_fmt_descriptors[pix_fmt];
79 int match = 1;79 int match = 1;
@@ -110,10 +110,10 @@ static int libopenjpeg_matches_pix_fmt(const opj_image_t *img, · 30 unmodified lines
110 return match;110 return match;
111}111}
112 112
113static enum PixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image)113static enum AVPixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image)
114{114{
115 int index;115 int index;
116 const enum PixelFormat *possible_fmts = NULL;116 const enum AVPixelFormat *possible_fmts = NULL;
117 int possible_fmts_nb = 0;117 int possible_fmts_nb = 0;
118 118
119 switch (image->color_space) {119 switch (image->color_space) {
@@ -141,14 +141,14 @@ static enum PixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image) · 21 unmodified lines
141 }141 }
142 }142 }
143 143
144 return PIX_FMT_NONE;144 return AV_PIX_FMT_NONE;
145}145}
146 146
147static inline int libopenjpeg_ispacked(enum PixelFormat pix_fmt)147static inline int libopenjpeg_ispacked(enum AVPixelFormat pix_fmt)
148{148{
149 int i, component_plane;149 int i, component_plane;
150 150
151 if (pix_fmt == PIX_FMT_GRAY16)151 if (pix_fmt == AV_PIX_FMT_GRAY16)
152 return 0;152 return 0;
153 153
154 component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane;154 component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane;
@@ -328,14 +328,14 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, · 173 unmodified lines
328 328
329 avcodec_set_dimensions(avctx, width, height);329 avcodec_set_dimensions(avctx, width, height);
330 330
331 if (avctx->pix_fmt != PIX_FMT_NONE)331 if (avctx->pix_fmt != AV_PIX_FMT_NONE)
332 if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))332 if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt))
333 avctx->pix_fmt = PIX_FMT_NONE;333 avctx->pix_fmt = AV_PIX_FMT_NONE;
334 334
335 if (avctx->pix_fmt == PIX_FMT_NONE)335 if (avctx->pix_fmt == AV_PIX_FMT_NONE)
336 avctx->pix_fmt = libopenjpeg_guess_pix_fmt(image);336 avctx->pix_fmt = libopenjpeg_guess_pix_fmt(image);
337 337
338 if (avctx->pix_fmt == PIX_FMT_NONE) {338 if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
339 av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n");339 av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n");
340 ret = AVERROR_INVALIDDATA;340 ret = AVERROR_INVALIDDATA;
341 goto done;341 goto done;
libavcodec/libopenjpegenc.c+54−54
@@ -87,32 +87,32 @@ static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx, · 86 unmodified lines
87 sub_dy[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h;87 sub_dy[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h;
88 88
89 switch (avctx->pix_fmt) {89 switch (avctx->pix_fmt) {
90 case PIX_FMT_GRAY8:90 case AV_PIX_FMT_GRAY8:
91 case PIX_FMT_GRAY16:91 case AV_PIX_FMT_GRAY16:
92 case PIX_FMT_Y400A:92 case AV_PIX_FMT_Y400A:
93 color_space = CLRSPC_GRAY;93 color_space = CLRSPC_GRAY;
94 break;94 break;
95 case PIX_FMT_RGB24:95 case AV_PIX_FMT_RGB24:
96 case PIX_FMT_RGBA:96 case AV_PIX_FMT_RGBA:
97 case PIX_FMT_RGB48:97 case AV_PIX_FMT_RGB48:
98 color_space = CLRSPC_SRGB;98 color_space = CLRSPC_SRGB;
99 break;99 break;
100 case PIX_FMT_YUV410P:100 case AV_PIX_FMT_YUV410P:
101 case PIX_FMT_YUV411P:101 case AV_PIX_FMT_YUV411P:
102 case PIX_FMT_YUV420P:102 case AV_PIX_FMT_YUV420P:
103 case PIX_FMT_YUV422P:103 case AV_PIX_FMT_YUV422P:
104 case PIX_FMT_YUV440P:104 case AV_PIX_FMT_YUV440P:
105 case PIX_FMT_YUV444P:105 case AV_PIX_FMT_YUV444P:
106 case PIX_FMT_YUVA420P:106 case AV_PIX_FMT_YUVA420P:
107 case PIX_FMT_YUV420P9:107 case AV_PIX_FMT_YUV420P9:
108 case PIX_FMT_YUV422P9:108 case AV_PIX_FMT_YUV422P9:
109 case PIX_FMT_YUV444P9:109 case AV_PIX_FMT_YUV444P9:
110 case PIX_FMT_YUV420P10:110 case AV_PIX_FMT_YUV420P10:
111 case PIX_FMT_YUV422P10:111 case AV_PIX_FMT_YUV422P10:
112 case PIX_FMT_YUV444P10:112 case AV_PIX_FMT_YUV444P10:
113 case PIX_FMT_YUV420P16:113 case AV_PIX_FMT_YUV420P16:
114 case PIX_FMT_YUV422P16:114 case AV_PIX_FMT_YUV422P16:
115 case PIX_FMT_YUV444P16:115 case AV_PIX_FMT_YUV444P16:
116 color_space = CLRSPC_SYCC;116 color_space = CLRSPC_SYCC;
117 break;117 break;
118 default:118 default:
@@ -302,34 +302,34 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 183 unmodified lines
302 image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1;302 image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1;
303 303
304 switch (avctx->pix_fmt) {304 switch (avctx->pix_fmt) {
305 case PIX_FMT_RGB24:305 case AV_PIX_FMT_RGB24:
306 case PIX_FMT_RGBA:306 case AV_PIX_FMT_RGBA:
307 case PIX_FMT_Y400A:307 case AV_PIX_FMT_Y400A:
308 libopenjpeg_copy_packed8(avctx, frame, image);308 libopenjpeg_copy_packed8(avctx, frame, image);
309 break;309 break;
310 case PIX_FMT_RGB48:310 case AV_PIX_FMT_RGB48:
311 libopenjpeg_copy_packed16(avctx, frame, image);311 libopenjpeg_copy_packed16(avctx, frame, image);
312 break;312 break;
313 case PIX_FMT_GRAY8:313 case AV_PIX_FMT_GRAY8:
314 case PIX_FMT_YUV410P:314 case AV_PIX_FMT_YUV410P:
315 case PIX_FMT_YUV411P:315 case AV_PIX_FMT_YUV411P:
316 case PIX_FMT_YUV420P:316 case AV_PIX_FMT_YUV420P:
317 case PIX_FMT_YUV422P:317 case AV_PIX_FMT_YUV422P:
318 case PIX_FMT_YUV440P:318 case AV_PIX_FMT_YUV440P:
319 case PIX_FMT_YUV444P:319 case AV_PIX_FMT_YUV444P:
320 case PIX_FMT_YUVA420P:320 case AV_PIX_FMT_YUVA420P:
321 libopenjpeg_copy_unpacked8(avctx, frame, image);321 libopenjpeg_copy_unpacked8(avctx, frame, image);
322 break;322 break;
323 case PIX_FMT_GRAY16:323 case AV_PIX_FMT_GRAY16:
324 case PIX_FMT_YUV420P9:324 case AV_PIX_FMT_YUV420P9:
325 case PIX_FMT_YUV422P9:325 case AV_PIX_FMT_YUV422P9:
326 case PIX_FMT_YUV444P9:326 case AV_PIX_FMT_YUV444P9:
327 case PIX_FMT_YUV444P10:327 case AV_PIX_FMT_YUV444P10:
328 case PIX_FMT_YUV422P10:328 case AV_PIX_FMT_YUV422P10:
329 case PIX_FMT_YUV420P10:329 case AV_PIX_FMT_YUV420P10:
330 case PIX_FMT_YUV444P16:330 case AV_PIX_FMT_YUV444P16:
331 case PIX_FMT_YUV422P16:331 case AV_PIX_FMT_YUV422P16:
332 case PIX_FMT_YUV420P16:332 case AV_PIX_FMT_YUV420P16:
333 libopenjpeg_copy_unpacked16(avctx, frame, image);333 libopenjpeg_copy_unpacked16(avctx, frame, image);
334 break;334 break;
335 default:335 default:
@@ -421,16 +421,16 @@ AVCodec ff_libopenjpeg_encoder = { · 85 unmodified lines
421 .encode2 = libopenjpeg_encode_frame,421 .encode2 = libopenjpeg_encode_frame,
422 .close = libopenjpeg_encode_close,422 .close = libopenjpeg_encode_close,
423 .capabilities = 0,423 .capabilities = 0,
424 .pix_fmts = (const enum PixelFormat[]) {424 .pix_fmts = (const enum AVPixelFormat[]) {
425 PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_RGB48,425 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48,
426 PIX_FMT_GRAY8, PIX_FMT_GRAY16, PIX_FMT_Y400A,426 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_Y400A,
427 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUVA420P,427 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P,
428 PIX_FMT_YUV440P, PIX_FMT_YUV444P,428 AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
429 PIX_FMT_YUV411P, PIX_FMT_YUV410P,429 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
430 PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, PIX_FMT_YUV444P9,430 AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
431 PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_YUV444P10,431 AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
432 PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16,432 AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
433 PIX_FMT_NONE433 AV_PIX_FMT_NONE
434 },434 },
435 .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),435 .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
436 .priv_class = &class,436 .priv_class = &class,
libavcodec/libschroedinger.h+4−4
@@ -101,13 +101,13 @@ void *ff_schro_queue_pop(FFSchroQueue *queue); · 100 unmodified lines
101void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *));101void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *));
102 102
103static const struct {103static const struct {
104 enum PixelFormat ff_pix_fmt;104 enum AVPixelFormat ff_pix_fmt;
105 SchroChromaFormat schro_pix_fmt;105 SchroChromaFormat schro_pix_fmt;
106 SchroFrameFormat schro_frame_fmt;106 SchroFrameFormat schro_frame_fmt;
107} schro_pixel_format_map[] = {107} schro_pixel_format_map[] = {
108 { PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 },108 { AV_PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 },
109 { PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 },109 { AV_PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 },
110 { PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 },110 { AV_PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 },
111};111};
112 112
113/**113/**
libavcodec/libschroedingerdec.c+2−2
@@ -138,7 +138,7 @@ static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx) · 137 unmodified lines
138/**138/**
139* Returns Libav chroma format.139* Returns Libav chroma format.
140*/140*/
141static enum PixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt)141static enum AVPixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt)
142{142{
143 int num_formats = sizeof(schro_pixel_format_map) /143 int num_formats = sizeof(schro_pixel_format_map) /
144 sizeof(schro_pixel_format_map[0]);144 sizeof(schro_pixel_format_map[0]);
@@ -147,7 +147,7 @@ static enum PixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt) · 2 unmodified lines
147 for (idx = 0; idx < num_formats; ++idx)147 for (idx = 0; idx < num_formats; ++idx)
148 if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)148 if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)
149 return schro_pixel_format_map[idx].ff_pix_fmt;149 return schro_pixel_format_map[idx].ff_pix_fmt;
150 return PIX_FMT_NONE;150 return AV_PIX_FMT_NONE;
151}151}
152 152
153static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext)153static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext)
libavcodec/libschroedingerenc.c+2−2
@@ -448,8 +448,8 @@ AVCodec ff_libschroedinger_encoder = { · 447 unmodified lines
448 .encode2 = libschroedinger_encode_frame,448 .encode2 = libschroedinger_encode_frame,
449 .close = libschroedinger_encode_close,449 .close = libschroedinger_encode_close,
450 .capabilities = CODEC_CAP_DELAY,450 .capabilities = CODEC_CAP_DELAY,
451 .pix_fmts = (const enum PixelFormat[]){451 .pix_fmts = (const enum AVPixelFormat[]){
452 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE452 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
453 },453 },
454 .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),454 .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
455};455};
libavcodec/libtheoraenc.c+5−5
@@ -187,11 +187,11 @@ static av_cold int encode_init(AVCodecContext* avc_context) · 186 unmodified lines
187 else187 else
188 t_info.colorspace = TH_CS_UNSPECIFIED;188 t_info.colorspace = TH_CS_UNSPECIFIED;
189 189
190 if (avc_context->pix_fmt == PIX_FMT_YUV420P)190 if (avc_context->pix_fmt == AV_PIX_FMT_YUV420P)
191 t_info.pixel_fmt = TH_PF_420;191 t_info.pixel_fmt = TH_PF_420;
192 else if (avc_context->pix_fmt == PIX_FMT_YUV422P)192 else if (avc_context->pix_fmt == AV_PIX_FMT_YUV422P)
193 t_info.pixel_fmt = TH_PF_422;193 t_info.pixel_fmt = TH_PF_422;
194 else if (avc_context->pix_fmt == PIX_FMT_YUV444P)194 else if (avc_context->pix_fmt == AV_PIX_FMT_YUV444P)
195 t_info.pixel_fmt = TH_PF_444;195 t_info.pixel_fmt = TH_PF_444;
196 else {196 else {
197 av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");197 av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");
@@ -370,8 +370,8 @@ AVCodec ff_libtheora_encoder = { · 172 unmodified lines
370 .close = encode_close,370 .close = encode_close,
371 .encode2 = encode_frame,371 .encode2 = encode_frame,
372 .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary372 .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary
373 .pix_fmts = (const enum PixelFormat[]){373 .pix_fmts = (const enum AVPixelFormat[]){
374 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE374 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
375 },375 },
376 .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),376 .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),
377};377};
libavcodec/libvpxdec.c+1−1
@@ -54,7 +54,7 @@ static av_cold int vp8_init(AVCodecContext *avctx) · 53 unmodified lines
54 return AVERROR(EINVAL);54 return AVERROR(EINVAL);
55 }55 }
56 56
57 avctx->pix_fmt = PIX_FMT_YUV420P;57 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
58 return 0;58 return 0;
59}59}
60 60
libavcodec/libvpxenc.c+1−1
@@ -580,7 +580,7 @@ AVCodec ff_libvpx_encoder = { · 579 unmodified lines
580 .encode2 = vp8_encode,580 .encode2 = vp8_encode,
581 .close = vp8_free,581 .close = vp8_free,
582 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,582 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
583 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },583 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
584 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),584 .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
585 .priv_class = &class,585 .priv_class = &class,
586 .defaults = defaults,586 .defaults = defaults,
libavcodec/libx264.c+26−26
@@ -206,18 +206,18 @@ static av_cold int X264_close(AVCodecContext *avctx) · 205 unmodified lines
206 return 0;206 return 0;
207}207}
208 208
209static int convert_pix_fmt(enum PixelFormat pix_fmt)209static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
210{210{
211 switch (pix_fmt) {211 switch (pix_fmt) {
212 case PIX_FMT_YUV420P:212 case AV_PIX_FMT_YUV420P:
213 case PIX_FMT_YUVJ420P:213 case AV_PIX_FMT_YUVJ420P:
214 case PIX_FMT_YUV420P9:214 case AV_PIX_FMT_YUV420P9:
215 case PIX_FMT_YUV420P10: return X264_CSP_I420;215 case AV_PIX_FMT_YUV420P10: return X264_CSP_I420;
216 case PIX_FMT_YUV422P:216 case AV_PIX_FMT_YUV422P:
217 case PIX_FMT_YUV422P10: return X264_CSP_I422;217 case AV_PIX_FMT_YUV422P10: return X264_CSP_I422;
218 case PIX_FMT_YUV444P:218 case AV_PIX_FMT_YUV444P:
219 case PIX_FMT_YUV444P9:219 case AV_PIX_FMT_YUV444P9:
220 case PIX_FMT_YUV444P10: return X264_CSP_I444;220 case AV_PIX_FMT_YUV444P10: return X264_CSP_I444;
221 };221 };
222 return 0;222 return 0;
223}223}
@@ -402,7 +402,7 @@ static av_cold int X264_init(AVCodecContext *avctx) · 178 unmodified lines
402 402
403 x4->params.i_slice_count = avctx->slices;403 x4->params.i_slice_count = avctx->slices;
404 404
405 x4->params.vui.b_fullrange = avctx->pix_fmt == PIX_FMT_YUVJ420P;405 x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P;
406 406
407 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)407 if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
408 x4->params.b_repeat_headers = 0;408 x4->params.b_repeat_headers = 0;
@@ -447,23 +447,23 @@ static av_cold int X264_init(AVCodecContext *avctx) · 38 unmodified lines
447 return 0;447 return 0;
448}448}
449 449
450static const enum PixelFormat pix_fmts_8bit[] = {450static const enum AVPixelFormat pix_fmts_8bit[] = {
451 PIX_FMT_YUV420P,451 AV_PIX_FMT_YUV420P,
452 PIX_FMT_YUVJ420P,452 AV_PIX_FMT_YUVJ420P,
453 PIX_FMT_YUV422P,453 AV_PIX_FMT_YUV422P,
454 PIX_FMT_YUV444P,454 AV_PIX_FMT_YUV444P,
455 PIX_FMT_NONE455 AV_PIX_FMT_NONE
456};456};
457static const enum PixelFormat pix_fmts_9bit[] = {457static const enum AVPixelFormat pix_fmts_9bit[] = {
458 PIX_FMT_YUV420P9,458 AV_PIX_FMT_YUV420P9,
459 PIX_FMT_YUV444P9,459 AV_PIX_FMT_YUV444P9,
460 PIX_FMT_NONE460 AV_PIX_FMT_NONE
461};461};
462static const enum PixelFormat pix_fmts_10bit[] = {462static const enum AVPixelFormat pix_fmts_10bit[] = {
463 PIX_FMT_YUV420P10,463 AV_PIX_FMT_YUV420P10,
464 PIX_FMT_YUV422P10,464 AV_PIX_FMT_YUV422P10,
465 PIX_FMT_YUV444P10,465 AV_PIX_FMT_YUV444P10,
466 PIX_FMT_NONE466 AV_PIX_FMT_NONE
467};467};
468 468
469static av_cold void X264_init_static(AVCodec *codec)469static av_cold void X264_init_static(AVCodec *codec)
libavcodec/libxavs.c+1−1
@@ -427,7 +427,7 @@ AVCodec ff_libxavs_encoder = { · 426 unmodified lines
427 .encode2 = XAVS_frame,427 .encode2 = XAVS_frame,
428 .close = XAVS_close,428 .close = XAVS_close,
429 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,429 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS,
430 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE },430 .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
431 .long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"),431 .long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"),
432 .priv_class = &class,432 .priv_class = &class,
433 .defaults = xavs_defaults,433 .defaults = xavs_defaults,
libavcodec/libxvid.c+2−2
@@ -657,7 +657,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 656 unmodified lines
657 xvid_enc_frame.length = pkt->size;657 xvid_enc_frame.length = pkt->size;
658 658
659 /* Initialize input image fields */659 /* Initialize input image fields */
660 if( avctx->pix_fmt != PIX_FMT_YUV420P ) {660 if( avctx->pix_fmt != AV_PIX_FMT_YUV420P ) {
661 av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n");661 av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n");
662 return -1;662 return -1;
663 }663 }
@@ -783,6 +783,6 @@ AVCodec ff_libxvid_encoder = { · 119 unmodified lines
783 .init = xvid_encode_init,783 .init = xvid_encode_init,
784 .encode2 = xvid_encode_frame,784 .encode2 = xvid_encode_frame,
785 .close = xvid_encode_close,785 .close = xvid_encode_close,
786 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },786 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
787 .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"),787 .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"),
788};788};
libavcodec/ljpegenc.c+2−2
@@ -51,7 +51,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt, · 50 unmodified lines
51 const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0];51 const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0];
52 int ret, max_pkt_size = FF_MIN_BUFFER_SIZE;52 int ret, max_pkt_size = FF_MIN_BUFFER_SIZE;
53 53
54 if (avctx->pix_fmt == PIX_FMT_BGRA)54 if (avctx->pix_fmt == AV_PIX_FMT_BGRA)
55 max_pkt_size += width * height * 3 * 4;55 max_pkt_size += width * height * 3 * 4;
56 else {56 else {
57 max_pkt_size += mb_width * mb_height * 3 * 457 max_pkt_size += mb_width * mb_height * 3 * 4
@@ -72,7 +72,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt, · 14 unmodified lines
72 72
73 s->header_bits= put_bits_count(&s->pb);73 s->header_bits= put_bits_count(&s->pb);
74 74
75 if(avctx->pix_fmt == PIX_FMT_BGRA){75 if(avctx->pix_fmt == AV_PIX_FMT_BGRA){
76 int x, y, i;76 int x, y, i;
77 const int linesize= p->linesize[0];77 const int linesize= p->linesize[0];
78 uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;78 uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;
libavcodec/loco.c+4−4
@@ -254,16 +254,16 @@ static av_cold int decode_init(AVCodecContext *avctx){ · 253 unmodified lines
254 l->mode = AV_RL32(avctx->extradata + 4);254 l->mode = AV_RL32(avctx->extradata + 4);
255 switch(l->mode) {255 switch(l->mode) {
256 case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:256 case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
257 avctx->pix_fmt = PIX_FMT_YUV422P;257 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
258 break;258 break;
259 case LOCO_CRGB: case LOCO_RGB:259 case LOCO_CRGB: case LOCO_RGB:
260 avctx->pix_fmt = PIX_FMT_BGR24;260 avctx->pix_fmt = AV_PIX_FMT_BGR24;
261 break;261 break;
262 case LOCO_CYV12: case LOCO_YV12:262 case LOCO_CYV12: case LOCO_YV12:
263 avctx->pix_fmt = PIX_FMT_YUV420P;263 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
264 break;264 break;
265 case LOCO_CRGBA: case LOCO_RGBA:265 case LOCO_CRGBA: case LOCO_RGBA:
266 avctx->pix_fmt = PIX_FMT_RGB32;266 avctx->pix_fmt = AV_PIX_FMT_RGB32;
267 break;267 break;
268 default:268 default:
269 av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode);269 av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode);
libavcodec/mdec.c+1−1
@@ -235,7 +235,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ · 234 unmodified lines
235 avctx->idct_algo = FF_IDCT_SIMPLE;235 avctx->idct_algo = FF_IDCT_SIMPLE;
236 p->qstride= 0;236 p->qstride= 0;
237 p->qscale_table= av_mallocz(a->mb_width);237 p->qscale_table= av_mallocz(a->mb_width);
238 avctx->pix_fmt= PIX_FMT_YUVJ420P;238 avctx->pix_fmt= AV_PIX_FMT_YUVJ420P;
239 239
240 return 0;240 return 0;
241}241}
libavcodec/mimic.c+1−1
@@ -340,7 +340,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, · 339 unmodified lines
340 ctx->avctx = avctx;340 ctx->avctx = avctx;
341 avctx->width = width;341 avctx->width = width;
342 avctx->height = height;342 avctx->height = height;
343 avctx->pix_fmt = PIX_FMT_YUV420P;343 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
344 for(i = 0; i < 3; i++) {344 for(i = 0; i < 3; i++) {
345 ctx->num_vblocks[i] = -((-height) >> (3 + !!i));345 ctx->num_vblocks[i] = -((-height) >> (3 + !!i));
346 ctx->num_hblocks[i] = width >> (3 + !!i) ;346 ctx->num_hblocks[i] = width >> (3 + !!i) ;
libavcodec/mjpegdec.c+9−9
@@ -321,22 +321,22 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) · 320 unmodified lines
321 switch (pix_fmt_id) {321 switch (pix_fmt_id) {
322 case 0x11111100:322 case 0x11111100:
323 if (s->rgb)323 if (s->rgb)
324 s->avctx->pix_fmt = PIX_FMT_BGRA;324 s->avctx->pix_fmt = AV_PIX_FMT_BGRA;
325 else325 else
326 s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;326 s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
327 assert(s->nb_components == 3);327 assert(s->nb_components == 3);
328 break;328 break;
329 case 0x11000000:329 case 0x11000000:
330 s->avctx->pix_fmt = PIX_FMT_GRAY8;330 s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
331 break;331 break;
332 case 0x12111100:332 case 0x12111100:
333 s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV440P : PIX_FMT_YUVJ440P;333 s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
334 break;334 break;
335 case 0x21111100:335 case 0x21111100:
336 s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P;336 s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
337 break;337 break;
338 case 0x22111100:338 case 0x22111100:
339 s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P;339 s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
340 break;340 break;
341 default:341 default:
342 av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);342 av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
@@ -344,11 +344,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) · 1 unmodified line
344 }344 }
345 if (s->ls) {345 if (s->ls) {
346 if (s->nb_components > 1)346 if (s->nb_components > 1)
347 s->avctx->pix_fmt = PIX_FMT_RGB24;347 s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
348 else if (s->bits <= 8)348 else if (s->bits <= 8)
349 s->avctx->pix_fmt = PIX_FMT_GRAY8;349 s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
350 else350 else
351 s->avctx->pix_fmt = PIX_FMT_GRAY16;351 s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
352 }352 }
353 353
354 if (s->picture_ptr->data[0])354 if (s->picture_ptr->data[0])
libavcodec/mjpegenc.c+6−6
@@ -181,9 +181,9 @@ static void jpeg_put_comments(MpegEncContext *s) · 180 unmodified lines
181 AV_WB16(ptr, size);181 AV_WB16(ptr, size);
182 }182 }
183 183
184 if( s->avctx->pix_fmt == PIX_FMT_YUV420P184 if( s->avctx->pix_fmt == AV_PIX_FMT_YUV420P
185 ||s->avctx->pix_fmt == PIX_FMT_YUV422P185 ||s->avctx->pix_fmt == AV_PIX_FMT_YUV422P
186 ||s->avctx->pix_fmt == PIX_FMT_YUV444P){186 ||s->avctx->pix_fmt == AV_PIX_FMT_YUV444P){
187 put_marker(p, COM);187 put_marker(p, COM);
188 flush_put_bits(p);188 flush_put_bits(p);
189 ptr = put_bits_ptr(p);189 ptr = put_bits_ptr(p);
@@ -211,7 +211,7 @@ void ff_mjpeg_encode_picture_header(MpegEncContext *s) · 21 unmodified lines
211 }211 }
212 212
213 put_bits(&s->pb, 16, 17);213 put_bits(&s->pb, 16, 17);
214 if(lossless && s->avctx->pix_fmt == PIX_FMT_BGRA)214 if(lossless && s->avctx->pix_fmt == AV_PIX_FMT_BGRA)
215 put_bits(&s->pb, 8, 9); /* 9 bits/component RCT */215 put_bits(&s->pb, 8, 9); /* 9 bits/component RCT */
216 else216 else
217 put_bits(&s->pb, 8, 8); /* 8 bits/component */217 put_bits(&s->pb, 8, 8); /* 8 bits/component */
@@ -452,8 +452,8 @@ AVCodec ff_mjpeg_encoder = { · 234 unmodified lines
452 .init = ff_MPV_encode_init,452 .init = ff_MPV_encode_init,
453 .encode2 = ff_MPV_encode_picture,453 .encode2 = ff_MPV_encode_picture,
454 .close = ff_MPV_encode_end,454 .close = ff_MPV_encode_end,
455 .pix_fmts = (const enum PixelFormat[]){455 .pix_fmts = (const enum AVPixelFormat[]){
456 PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE456 AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_NONE
457 },457 },
458 .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"),458 .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"),
459};459};
libavcodec/mmvideo.c+1−1
@@ -58,7 +58,7 @@ static av_cold int mm_decode_init(AVCodecContext *avctx) · 57 unmodified lines
58 58
59 s->avctx = avctx;59 s->avctx = avctx;
60 60
61 avctx->pix_fmt = PIX_FMT_PAL8;61 avctx->pix_fmt = AV_PIX_FMT_PAL8;
62 62
63 s->frame.reference = 1;63 s->frame.reference = 1;
64 64
libavcodec/motionpixels.c+1−1
@@ -62,7 +62,7 @@ static av_cold int mp_decode_init(AVCodecContext *avctx) · 61 unmodified lines
62 mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;62 mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
63 mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));63 mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
64 mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));64 mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
65 avctx->pix_fmt = PIX_FMT_RGB555;65 avctx->pix_fmt = AV_PIX_FMT_RGB555;
66 return 0;66 return 0;
67}67}
68 68
libavcodec/mpeg12.c+12−12
@@ -1171,12 +1171,12 @@ static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm, · 1170 unmodified lines
1171 }1171 }
1172}1172}
1173 1173
1174static const enum PixelFormat pixfmt_xvmc_mpg2_420[] = {1174static const enum AVPixelFormat pixfmt_xvmc_mpg2_420[] = {
1175 PIX_FMT_XVMC_MPEG2_IDCT,1175 AV_PIX_FMT_XVMC_MPEG2_IDCT,
1176 PIX_FMT_XVMC_MPEG2_MC,1176 AV_PIX_FMT_XVMC_MPEG2_MC,
1177 PIX_FMT_NONE };1177 AV_PIX_FMT_NONE };
1178 1178
1179static enum PixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)1179static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
1180{1180{
1181 Mpeg1Context *s1 = avctx->priv_data;1181 Mpeg1Context *s1 = avctx->priv_data;
1182 MpegEncContext *s = &s1->mpeg_enc_ctx;1182 MpegEncContext *s = &s1->mpeg_enc_ctx;
@@ -1185,16 +1185,16 @@ static enum PixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) · 2 unmodified lines
1185 return avctx->get_format(avctx, pixfmt_xvmc_mpg2_420);1185 return avctx->get_format(avctx, pixfmt_xvmc_mpg2_420);
1186 else if (avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) {1186 else if (avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) {
1187 if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO)1187 if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO)
1188 return PIX_FMT_VDPAU_MPEG1;1188 return AV_PIX_FMT_VDPAU_MPEG1;
1189 else1189 else
1190 return PIX_FMT_VDPAU_MPEG2;1190 return AV_PIX_FMT_VDPAU_MPEG2;
1191 } else {1191 } else {
1192 if (s->chroma_format < 2)1192 if (s->chroma_format < 2)
1193 return avctx->get_format(avctx, ff_hwaccel_pixfmt_list_420);1193 return avctx->get_format(avctx, ff_hwaccel_pixfmt_list_420);
1194 else if (s->chroma_format == 2)1194 else if (s->chroma_format == 2)
1195 return PIX_FMT_YUV422P;1195 return AV_PIX_FMT_YUV422P;
1196 else1196 else
1197 return PIX_FMT_YUV444P;1197 return AV_PIX_FMT_YUV444P;
1198 }1198 }
1199}1199}
1200 1200
@@ -1289,7 +1289,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) · 88 unmodified lines
1289 avctx->pix_fmt = mpeg_get_pixelformat(avctx);1289 avctx->pix_fmt = mpeg_get_pixelformat(avctx);
1290 avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);1290 avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
1291 // until then pix_fmt may be changed right after codec init1291 // until then pix_fmt may be changed right after codec init
1292 if (avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT ||1292 if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
1293 avctx->hwaccel ||1293 avctx->hwaccel ||
1294 s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)1294 s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
1295 if (avctx->idct_algo == FF_IDCT_AUTO)1295 if (avctx->idct_algo == FF_IDCT_AUTO)
@@ -2036,7 +2036,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx) · 740 unmodified lines
2036 avctx->pix_fmt = mpeg_get_pixelformat(avctx);2036 avctx->pix_fmt = mpeg_get_pixelformat(avctx);
2037 avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);2037 avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
2038 2038
2039 if (avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ||2039 if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ||
2040 s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)2040 s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
2041 if (avctx->idct_algo == FF_IDCT_AUTO)2041 if (avctx->idct_algo == FF_IDCT_AUTO)
2042 avctx->idct_algo = FF_IDCT_SIMPLE;2042 avctx->idct_algo = FF_IDCT_SIMPLE;
@@ -2539,7 +2539,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx) · 496 unmodified lines
2539 }2539 }
2540 mpeg_decode_init(avctx);2540 mpeg_decode_init(avctx);
2541 2541
2542 avctx->pix_fmt = PIX_FMT_XVMC_MPEG2_IDCT;2542 avctx->pix_fmt = AV_PIX_FMT_XVMC_MPEG2_IDCT;
2543 avctx->xvmc_acceleration = 2; // 2 - the blocks are packed!2543 avctx->xvmc_acceleration = 2; // 2 - the blocks are packed!
2544 2544
2545 return 0;2545 return 0;
libavcodec/mpeg12enc.c+4−4
@@ -959,8 +959,8 @@ AVCodec ff_mpeg1video_encoder = { · 958 unmodified lines
959 .encode2 = ff_MPV_encode_picture,959 .encode2 = ff_MPV_encode_picture,
960 .close = ff_MPV_encode_end,960 .close = ff_MPV_encode_end,
961 .supported_framerates = avpriv_frame_rate_tab+1,961 .supported_framerates = avpriv_frame_rate_tab+1,
962 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P,962 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P,
963 PIX_FMT_NONE },963 AV_PIX_FMT_NONE },
964 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,964 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
965 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),965 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
966 .priv_class = &mpeg1_class,966 .priv_class = &mpeg1_class,
@@ -975,8 +975,8 @@ AVCodec ff_mpeg2video_encoder = { · 8 unmodified lines
975 .encode2 = ff_MPV_encode_picture,975 .encode2 = ff_MPV_encode_picture,
976 .close = ff_MPV_encode_end,976 .close = ff_MPV_encode_end,
977 .supported_framerates = avpriv_frame_rate_tab + 1,977 .supported_framerates = avpriv_frame_rate_tab + 1,
978 .pix_fmts = (const enum PixelFormat[]){978 .pix_fmts = (const enum AVPixelFormat[]){
979 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE979 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE
980 },980 },
981 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,981 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
982 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),982 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
libavcodec/mpeg4videodec.c+2−2
@@ -2288,7 +2288,7 @@ AVCodec ff_mpeg4_vdpau_decoder = { · 2287 unmodified lines
2288 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |2288 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
2289 CODEC_CAP_HWACCEL_VDPAU,2289 CODEC_CAP_HWACCEL_VDPAU,
2290 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"),2290 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"),
2291 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_VDPAU_MPEG4,2291 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_MPEG4,
2292 PIX_FMT_NONE },2292 AV_PIX_FMT_NONE },
2293};2293};
2294#endif2294#endif
libavcodec/mpeg4videoenc.c+1−1
@@ -1339,7 +1339,7 @@ AVCodec ff_mpeg4_encoder = { · 1338 unmodified lines
1339 .init = encode_init,1339 .init = encode_init,
1340 .encode2 = ff_MPV_encode_picture,1340 .encode2 = ff_MPV_encode_picture,
1341 .close = ff_MPV_encode_end,1341 .close = ff_MPV_encode_end,
1342 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },1342 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
1343 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,1343 .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
1344 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),1344 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
1345 .priv_class = &mpeg4enc_class,1345 .priv_class = &mpeg4enc_class,
libavcodec/mpegvideo.c+11−11
@@ -125,17 +125,17 @@ const uint8_t *const ff_mpeg2_dc_scale_table[4] = { · 124 unmodified lines
125 mpeg2_dc_scale_table3,125 mpeg2_dc_scale_table3,
126};126};
127 127
128const enum PixelFormat ff_pixfmt_list_420[] = {128const enum AVPixelFormat ff_pixfmt_list_420[] = {
129 PIX_FMT_YUV420P,129 AV_PIX_FMT_YUV420P,
130 PIX_FMT_NONE130 AV_PIX_FMT_NONE
131};131};
132 132
133const enum PixelFormat ff_hwaccel_pixfmt_list_420[] = {133const enum AVPixelFormat ff_hwaccel_pixfmt_list_420[] = {
134 PIX_FMT_DXVA2_VLD,134 AV_PIX_FMT_DXVA2_VLD,
135 PIX_FMT_VAAPI_VLD,135 AV_PIX_FMT_VAAPI_VLD,
136 PIX_FMT_VDA_VLD,136 AV_PIX_FMT_VDA_VLD,
137 PIX_FMT_YUV420P,137 AV_PIX_FMT_YUV420P,
138 PIX_FMT_NONE138 AV_PIX_FMT_NONE
139};139};
140 140
141const uint8_t *avpriv_mpv_find_start_code(const uint8_t *restrict p,141const uint8_t *avpriv_mpv_find_start_code(const uint8_t *restrict p,
@@ -841,9 +841,9 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) · 699 unmodified lines
841 else if (s->codec_id != AV_CODEC_ID_H264)841 else if (s->codec_id != AV_CODEC_ID_H264)
842 s->mb_height = (s->height + 15) / 16;842 s->mb_height = (s->height + 15) / 16;
843 843
844 if (s->avctx->pix_fmt == PIX_FMT_NONE) {844 if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) {
845 av_log(s->avctx, AV_LOG_ERROR,845 av_log(s->avctx, AV_LOG_ERROR,
846 "decoding to PIX_FMT_NONE is not supported.\n");846 "decoding to AV_PIX_FMT_NONE is not supported.\n");
847 return -1;847 return -1;
848 }848 }
849 849
libavcodec/mpegvideo.h+2−2
@@ -809,8 +809,8 @@ void ff_MPV_motion(MpegEncContext *s, · 808 unmodified lines
809 */809 */
810int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared);810int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared);
811 811
812extern const enum PixelFormat ff_pixfmt_list_420[];812extern const enum AVPixelFormat ff_pixfmt_list_420[];
813extern const enum PixelFormat ff_hwaccel_pixfmt_list_420[];813extern const enum AVPixelFormat ff_hwaccel_pixfmt_list_420[];
814 814
815static inline void ff_update_block_index(MpegEncContext *s){815static inline void ff_update_block_index(MpegEncContext *s){
816 const int block_size = 8;816 const int block_size = 8;
libavcodec/mpegvideo_enc.c+25−25
@@ -278,50 +278,50 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 277 unmodified lines
278 278
279 switch (avctx->codec_id) {279 switch (avctx->codec_id) {
280 case AV_CODEC_ID_MPEG2VIDEO:280 case AV_CODEC_ID_MPEG2VIDEO:
281 if (avctx->pix_fmt != PIX_FMT_YUV420P &&281 if (avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
282 avctx->pix_fmt != PIX_FMT_YUV422P) {282 avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
283 av_log(avctx, AV_LOG_ERROR,283 av_log(avctx, AV_LOG_ERROR,
284 "only YUV420 and YUV422 are supported\n");284 "only YUV420 and YUV422 are supported\n");
285 return -1;285 return -1;
286 }286 }
287 break;287 break;
288 case AV_CODEC_ID_LJPEG:288 case AV_CODEC_ID_LJPEG:
289 if (avctx->pix_fmt != PIX_FMT_YUVJ420P &&289 if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P &&
290 avctx->pix_fmt != PIX_FMT_YUVJ422P &&290 avctx->pix_fmt != AV_PIX_FMT_YUVJ422P &&
291 avctx->pix_fmt != PIX_FMT_YUVJ444P &&291 avctx->pix_fmt != AV_PIX_FMT_YUVJ444P &&
292 avctx->pix_fmt != PIX_FMT_BGRA &&292 avctx->pix_fmt != AV_PIX_FMT_BGRA &&
293 ((avctx->pix_fmt != PIX_FMT_YUV420P &&293 ((avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
294 avctx->pix_fmt != PIX_FMT_YUV422P &&294 avctx->pix_fmt != AV_PIX_FMT_YUV422P &&
295 avctx->pix_fmt != PIX_FMT_YUV444P) ||295 avctx->pix_fmt != AV_PIX_FMT_YUV444P) ||
296 avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) {296 avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) {
297 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in LJPEG\n");297 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in LJPEG\n");
298 return -1;298 return -1;
299 }299 }
300 break;300 break;
301 case AV_CODEC_ID_MJPEG:301 case AV_CODEC_ID_MJPEG:
302 if (avctx->pix_fmt != PIX_FMT_YUVJ420P &&302 if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P &&
303 avctx->pix_fmt != PIX_FMT_YUVJ422P &&303 avctx->pix_fmt != AV_PIX_FMT_YUVJ422P &&
304 ((avctx->pix_fmt != PIX_FMT_YUV420P &&304 ((avctx->pix_fmt != AV_PIX_FMT_YUV420P &&
305 avctx->pix_fmt != PIX_FMT_YUV422P) ||305 avctx->pix_fmt != AV_PIX_FMT_YUV422P) ||
306 avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) {306 avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) {
307 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");307 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");
308 return -1;308 return -1;
309 }309 }
310 break;310 break;
311 default:311 default:
312 if (avctx->pix_fmt != PIX_FMT_YUV420P) {312 if (avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
313 av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n");313 av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n");
314 return -1;314 return -1;
315 }315 }
316 }316 }
317 317
318 switch (avctx->pix_fmt) {318 switch (avctx->pix_fmt) {
319 case PIX_FMT_YUVJ422P:319 case AV_PIX_FMT_YUVJ422P:
320 case PIX_FMT_YUV422P:320 case AV_PIX_FMT_YUV422P:
321 s->chroma_format = CHROMA_422;321 s->chroma_format = CHROMA_422;
322 break;322 break;
323 case PIX_FMT_YUVJ420P:323 case AV_PIX_FMT_YUVJ420P:
324 case PIX_FMT_YUV420P:324 case AV_PIX_FMT_YUV420P:
325 default:325 default:
326 s->chroma_format = CHROMA_420;326 s->chroma_format = CHROMA_420;
327 break;327 break;
@@ -640,7 +640,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 312 unmodified lines
640 s->out_format = FMT_MJPEG;640 s->out_format = FMT_MJPEG;
641 s->intra_only = 1; /* force intra only for jpeg */641 s->intra_only = 1; /* force intra only for jpeg */
642 if (avctx->codec->id == AV_CODEC_ID_LJPEG &&642 if (avctx->codec->id == AV_CODEC_ID_LJPEG &&
643 avctx->pix_fmt == PIX_FMT_BGRA) {643 avctx->pix_fmt == AV_PIX_FMT_BGRA) {
644 s->mjpeg_vsample[0] = s->mjpeg_hsample[0] =644 s->mjpeg_vsample[0] = s->mjpeg_hsample[0] =
645 s->mjpeg_vsample[1] = s->mjpeg_hsample[1] =645 s->mjpeg_vsample[1] = s->mjpeg_hsample[1] =
646 s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 1;646 s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 1;
@@ -1117,7 +1117,7 @@ static int estimate_best_b_count(MpegEncContext *s) · 470 unmodified lines
1117 c->me_cmp = s->avctx->me_cmp;1117 c->me_cmp = s->avctx->me_cmp;
1118 c->mb_cmp = s->avctx->mb_cmp;1118 c->mb_cmp = s->avctx->mb_cmp;
1119 c->me_sub_cmp = s->avctx->me_sub_cmp;1119 c->me_sub_cmp = s->avctx->me_sub_cmp;
1120 c->pix_fmt = PIX_FMT_YUV420P;1120 c->pix_fmt = AV_PIX_FMT_YUV420P;
1121 c->time_base = s->avctx->time_base;1121 c->time_base = s->avctx->time_base;
1122 c->max_b_frames = s->max_b_frames;1122 c->max_b_frames = s->max_b_frames;
1123 1123
@@ -4138,7 +4138,7 @@ AVCodec ff_h263_encoder = { · 3014 unmodified lines
4138 .init = ff_MPV_encode_init,4138 .init = ff_MPV_encode_init,
4139 .encode2 = ff_MPV_encode_picture,4139 .encode2 = ff_MPV_encode_picture,
4140 .close = ff_MPV_encode_end,4140 .close = ff_MPV_encode_end,
4141 .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},4141 .pix_fmts= (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE},
4142 .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"),4142 .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"),
4143 .priv_class = &h263_class,4143 .priv_class = &h263_class,
4144};4144};
@@ -4167,7 +4167,7 @@ AVCodec ff_h263p_encoder = { · 22 unmodified lines
4167 .encode2 = ff_MPV_encode_picture,4167 .encode2 = ff_MPV_encode_picture,
4168 .close = ff_MPV_encode_end,4168 .close = ff_MPV_encode_end,
4169 .capabilities = CODEC_CAP_SLICE_THREADS,4169 .capabilities = CODEC_CAP_SLICE_THREADS,
4170 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },4170 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
4171 .long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),4171 .long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"),
4172 .priv_class = &h263p_class,4172 .priv_class = &h263p_class,
4173};4173};
@@ -4182,7 +4182,7 @@ AVCodec ff_msmpeg4v2_encoder = { · 8 unmodified lines
4182 .init = ff_MPV_encode_init,4182 .init = ff_MPV_encode_init,
4183 .encode2 = ff_MPV_encode_picture,4183 .encode2 = ff_MPV_encode_picture,
4184 .close = ff_MPV_encode_end,4184 .close = ff_MPV_encode_end,
4185 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },4185 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
4186 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),4186 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"),
4187 .priv_class = &msmpeg4v2_class,4187 .priv_class = &msmpeg4v2_class,
4188};4188};
@@ -4197,7 +4197,7 @@ AVCodec ff_msmpeg4v3_encoder = { · 8 unmodified lines
4197 .init = ff_MPV_encode_init,4197 .init = ff_MPV_encode_init,
4198 .encode2 = ff_MPV_encode_picture,4198 .encode2 = ff_MPV_encode_picture,
4199 .close = ff_MPV_encode_end,4199 .close = ff_MPV_encode_end,
4200 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },4200 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
4201 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),4201 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"),
4202 .priv_class = &msmpeg4v3_class,4202 .priv_class = &msmpeg4v3_class,
4203};4203};
@@ -4212,7 +4212,7 @@ AVCodec ff_wmv1_encoder = { · 8 unmodified lines
4212 .init = ff_MPV_encode_init,4212 .init = ff_MPV_encode_init,
4213 .encode2 = ff_MPV_encode_picture,4213 .encode2 = ff_MPV_encode_picture,
4214 .close = ff_MPV_encode_end,4214 .close = ff_MPV_encode_end,
4215 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },4215 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
4216 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"),4216 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"),
4217 .priv_class = &wmv1_class,4217 .priv_class = &wmv1_class,
4218};4218};
libavcodec/msrle.c+2−2
@@ -56,10 +56,10 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) · 55 unmodified lines
56 switch (avctx->bits_per_coded_sample) {56 switch (avctx->bits_per_coded_sample) {
57 case 4:57 case 4:
58 case 8:58 case 8:
59 avctx->pix_fmt = PIX_FMT_PAL8;59 avctx->pix_fmt = AV_PIX_FMT_PAL8;
60 break;60 break;
61 case 24:61 case 24:
62 avctx->pix_fmt = PIX_FMT_BGR24;62 avctx->pix_fmt = AV_PIX_FMT_BGR24;
63 break;63 break;
64 default:64 default:
65 av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n");65 av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n");
libavcodec/mss1.c+1−1
@@ -197,7 +197,7 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx) · 196 unmodified lines
197 197
198 ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL);198 ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL);
199 199
200 avctx->pix_fmt = PIX_FMT_PAL8;200 avctx->pix_fmt = AV_PIX_FMT_PAL8;
201 201
202 return ret;202 return ret;
203}203}
libavcodec/mss2.c+6−6
@@ -396,11 +396,11 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, · 395 unmodified lines
396 return AVERROR_INVALIDDATA;396 return AVERROR_INVALIDDATA;
397 }397 }
398 398
399 avctx->pix_fmt = PIX_FMT_YUV420P;399 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
400 400
401 if (ff_MPV_frame_start(s, avctx) < 0) {401 if (ff_MPV_frame_start(s, avctx) < 0) {
402 av_log(v->s.avctx, AV_LOG_ERROR, "ff_MPV_frame_start error\n");402 av_log(v->s.avctx, AV_LOG_ERROR, "ff_MPV_frame_start error\n");
403 avctx->pix_fmt = PIX_FMT_RGB24;403 avctx->pix_fmt = AV_PIX_FMT_RGB24;
404 return -1;404 return -1;
405 }405 }
406 406
@@ -448,7 +448,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, · 41 unmodified lines
448 f->data[1], f->data[2], f->linesize[1],448 f->data[1], f->data[2], f->linesize[1],
449 w, h);449 w, h);
450 450
451 avctx->pix_fmt = PIX_FMT_RGB24;451 avctx->pix_fmt = AV_PIX_FMT_RGB24;
452 452
453 return 0;453 return 0;
454}454}
@@ -519,7 +519,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 64 unmodified lines
519 if (is_555 && (has_wmv9 || has_mv || c->slice_split && ctx->split_position))519 if (is_555 && (has_wmv9 || has_mv || c->slice_split && ctx->split_position))
520 return AVERROR_INVALIDDATA;520 return AVERROR_INVALIDDATA;
521 521
522 avctx->pix_fmt = is_555 ? PIX_FMT_RGB555 : PIX_FMT_RGB24;522 avctx->pix_fmt = is_555 ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_RGB24;
523 if (ctx->pic.data[0] && ctx->pic.format != avctx->pix_fmt)523 if (ctx->pic.data[0] && ctx->pic.format != avctx->pix_fmt)
524 avctx->release_buffer(avctx, &ctx->pic);524 avctx->release_buffer(avctx, &ctx->pic);
525 525
@@ -848,8 +848,8 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx) · 322 unmodified lines
848 }848 }
849 ff_mss2dsp_init(&ctx->dsp);849 ff_mss2dsp_init(&ctx->dsp);
850 850
851 avctx->pix_fmt = c->free_colours == 127 ? PIX_FMT_RGB555851 avctx->pix_fmt = c->free_colours == 127 ? AV_PIX_FMT_RGB555
852 : PIX_FMT_RGB24;852 : AV_PIX_FMT_RGB24;
853 853
854 return 0;854 return 0;
855}855}
libavcodec/mss3.c+1−1
@@ -835,7 +835,7 @@ static av_cold int mss3_decode_init(AVCodecContext *avctx) · 834 unmodified lines
835 }835 }
836 }836 }
837 837
838 avctx->pix_fmt = PIX_FMT_YUV420P;838 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
839 avctx->coded_frame = &c->pic;839 avctx->coded_frame = &c->pic;
840 840
841 init_coders(c);841 init_coders(c);
libavcodec/mss4.c+1−1
@@ -649,7 +649,7 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx) · 648 unmodified lines
649 }649 }
650 }650 }
651 651
652 avctx->pix_fmt = PIX_FMT_YUV444P;652 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
653 avctx->coded_frame = &c->pic;653 avctx->coded_frame = &c->pic;
654 654
655 return 0;655 return 0;
libavcodec/msvideo1.c+3−3
@@ -65,10 +65,10 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx) · 64 unmodified lines
65 /* figure out the colorspace based on the presence of a palette */65 /* figure out the colorspace based on the presence of a palette */
66 if (s->avctx->bits_per_coded_sample == 8) {66 if (s->avctx->bits_per_coded_sample == 8) {
67 s->mode_8bit = 1;67 s->mode_8bit = 1;
68 avctx->pix_fmt = PIX_FMT_PAL8;68 avctx->pix_fmt = AV_PIX_FMT_PAL8;
69 } else {69 } else {
70 s->mode_8bit = 0;70 s->mode_8bit = 0;
71 avctx->pix_fmt = PIX_FMT_RGB555;71 avctx->pix_fmt = AV_PIX_FMT_RGB555;
72 }72 }
73 73
74 s->frame.data[0] = NULL;74 s->frame.data[0] = NULL;
@@ -172,7 +172,7 @@ static void msvideo1_decode_8bit(Msvideo1Context *s) · 97 unmodified lines
172 }172 }
173 173
174 /* make the palette available on the way out */174 /* make the palette available on the way out */
175 if (s->avctx->pix_fmt == PIX_FMT_PAL8)175 if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8)
176 memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);176 memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
177}177}
178 178
libavcodec/nuv.c+3−3
@@ -74,8 +74,8 @@ static const uint8_t fallback_cquant[] = { · 73 unmodified lines
74static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height)74static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height)
75{75{
76 AVPicture pic;76 AVPicture pic;
77 avpicture_fill(&pic, src, PIX_FMT_YUV420P, width, height);77 avpicture_fill(&pic, src, AV_PIX_FMT_YUV420P, width, height);
78 av_picture_copy((AVPicture *)f, &pic, PIX_FMT_YUV420P, width, height);78 av_picture_copy((AVPicture *)f, &pic, AV_PIX_FMT_YUV420P, width, height);
79}79}
80 80
81/**81/**
@@ -269,7 +269,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 187 unmodified lines
269static av_cold int decode_init(AVCodecContext *avctx)269static av_cold int decode_init(AVCodecContext *avctx)
270{270{
271 NuvContext *c = avctx->priv_data;271 NuvContext *c = avctx->priv_data;
272 avctx->pix_fmt = PIX_FMT_YUV420P;272 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
273 c->pic.data[0] = NULL;273 c->pic.data[0] = NULL;
274 c->decomp_buf = NULL;274 c->decomp_buf = NULL;
275 c->quality = -1;275 c->quality = -1;
libavcodec/options.c+1−1
@@ -94,7 +94,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec) · 93 unmodified lines
94 s->execute = avcodec_default_execute;94 s->execute = avcodec_default_execute;
95 s->execute2 = avcodec_default_execute2;95 s->execute2 = avcodec_default_execute2;
96 s->sample_aspect_ratio = (AVRational){0,1};96 s->sample_aspect_ratio = (AVRational){0,1};
97 s->pix_fmt = PIX_FMT_NONE;97 s->pix_fmt = AV_PIX_FMT_NONE;
98 s->sample_fmt = AV_SAMPLE_FMT_NONE;98 s->sample_fmt = AV_SAMPLE_FMT_NONE;
99 99
100 s->reget_buffer = avcodec_default_reget_buffer;100 s->reget_buffer = avcodec_default_reget_buffer;
libavcodec/pamenc.c+8−8
@@ -52,25 +52,25 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 51 unmodified lines
52 h = avctx->height;52 h = avctx->height;
53 w = avctx->width;53 w = avctx->width;
54 switch (avctx->pix_fmt) {54 switch (avctx->pix_fmt) {
55 case PIX_FMT_MONOWHITE:55 case AV_PIX_FMT_MONOWHITE:
56 n = (w + 7) >> 3;56 n = (w + 7) >> 3;
57 depth = 1;57 depth = 1;
58 maxval = 1;58 maxval = 1;
59 tuple_type = "BLACKANDWHITE";59 tuple_type = "BLACKANDWHITE";
60 break;60 break;
61 case PIX_FMT_GRAY8:61 case AV_PIX_FMT_GRAY8:
62 n = w;62 n = w;
63 depth = 1;63 depth = 1;
64 maxval = 255;64 maxval = 255;
65 tuple_type = "GRAYSCALE";65 tuple_type = "GRAYSCALE";
66 break;66 break;
67 case PIX_FMT_RGB24:67 case AV_PIX_FMT_RGB24:
68 n = w * 3;68 n = w * 3;
69 depth = 3;69 depth = 3;
70 maxval = 255;70 maxval = 255;
71 tuple_type = "RGB";71 tuple_type = "RGB";
72 break;72 break;
73 case PIX_FMT_RGB32:73 case AV_PIX_FMT_RGB32:
74 n = w * 4;74 n = w * 4;
75 depth = 4;75 depth = 4;
76 maxval = 255;76 maxval = 255;
@@ -87,7 +87,7 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 10 unmodified lines
87 ptr = p->data[0];87 ptr = p->data[0];
88 linesize = p->linesize[0];88 linesize = p->linesize[0];
89 89
90 if (avctx->pix_fmt == PIX_FMT_RGB32) {90 if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
91 int j;91 int j;
92 unsigned int v;92 unsigned int v;
93 93
@@ -121,9 +121,9 @@ AVCodec ff_pam_encoder = { · 27 unmodified lines
121 .priv_data_size = sizeof(PNMContext),121 .priv_data_size = sizeof(PNMContext),
122 .init = ff_pnm_init,122 .init = ff_pnm_init,
123 .encode2 = pam_encode_frame,123 .encode2 = pam_encode_frame,
124 .pix_fmts = (const enum PixelFormat[]){124 .pix_fmts = (const enum AVPixelFormat[]){
125 PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE,125 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE,
126 PIX_FMT_NONE126 AV_PIX_FMT_NONE
127 },127 },
128 .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),128 .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
129};129};
libavcodec/pcx.c+2−2
@@ -122,7 +122,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 121 unmodified lines
122 122
123 switch ((nplanes<<8) + bits_per_pixel) {123 switch ((nplanes<<8) + bits_per_pixel) {
124 case 0x0308:124 case 0x0308:
125 avctx->pix_fmt = PIX_FMT_RGB24;125 avctx->pix_fmt = AV_PIX_FMT_RGB24;
126 break;126 break;
127 case 0x0108:127 case 0x0108:
128 case 0x0104:128 case 0x0104:
@@ -131,7 +131,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 2 unmodified lines
131 case 0x0401:131 case 0x0401:
132 case 0x0301:132 case 0x0301:
133 case 0x0201:133 case 0x0201:
134 avctx->pix_fmt = PIX_FMT_PAL8;134 avctx->pix_fmt = AV_PIX_FMT_PAL8;
135 break;135 break;
136 default:136 default:
137 av_log(avctx, AV_LOG_ERROR, "invalid PCX file\n");137 av_log(avctx, AV_LOG_ERROR, "invalid PCX file\n");
libavcodec/pcxenc.c+14−14
@@ -118,21 +118,21 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 117 unmodified lines
118 }118 }
119 119
120 switch (avctx->pix_fmt) {120 switch (avctx->pix_fmt) {
121 case PIX_FMT_RGB24:121 case AV_PIX_FMT_RGB24:
122 bpp = 8;122 bpp = 8;
123 nplanes = 3;123 nplanes = 3;
124 break;124 break;
125 case PIX_FMT_RGB8:125 case AV_PIX_FMT_RGB8:
126 case PIX_FMT_BGR8:126 case AV_PIX_FMT_BGR8:
127 case PIX_FMT_RGB4_BYTE:127 case AV_PIX_FMT_RGB4_BYTE:
128 case PIX_FMT_BGR4_BYTE:128 case AV_PIX_FMT_BGR4_BYTE:
129 case PIX_FMT_GRAY8:129 case AV_PIX_FMT_GRAY8:
130 case PIX_FMT_PAL8:130 case AV_PIX_FMT_PAL8:
131 bpp = 8;131 bpp = 8;
132 nplanes = 1;132 nplanes = 1;
133 pal = (uint32_t *)pict->data[1];133 pal = (uint32_t *)pict->data[1];
134 break;134 break;
135 case PIX_FMT_MONOBLACK:135 case AV_PIX_FMT_MONOBLACK:
136 bpp = 1;136 bpp = 1;
137 nplanes = 1;137 nplanes = 1;
138 pal = monoblack_pal;138 pal = monoblack_pal;
@@ -209,12 +209,12 @@ AVCodec ff_pcx_encoder = { · 70 unmodified lines
209 .priv_data_size = sizeof(PCXContext),209 .priv_data_size = sizeof(PCXContext),
210 .init = pcx_encode_init,210 .init = pcx_encode_init,
211 .encode2 = pcx_encode_frame,211 .encode2 = pcx_encode_frame,
212 .pix_fmts = (const enum PixelFormat[]){212 .pix_fmts = (const enum AVPixelFormat[]){
213 PIX_FMT_RGB24,213 AV_PIX_FMT_RGB24,
214 PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE,214 AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
215 PIX_FMT_GRAY8, PIX_FMT_PAL8,215 AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8,
216 PIX_FMT_MONOBLACK,216 AV_PIX_FMT_MONOBLACK,
217 PIX_FMT_NONE217 AV_PIX_FMT_NONE
218 },218 },
219 .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),219 .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"),
220};220};
libavcodec/pgssubdec.c+1−1
@@ -63,7 +63,7 @@ typedef struct PGSSubContext { · 62 unmodified lines
63 63
64static av_cold int init_decoder(AVCodecContext *avctx)64static av_cold int init_decoder(AVCodecContext *avctx)
65{65{
66 avctx->pix_fmt = PIX_FMT_PAL8;66 avctx->pix_fmt = AV_PIX_FMT_PAL8;
67 67
68 return 0;68 return 0;
69}69}
libavcodec/pictordec.c+1−1
@@ -136,7 +136,7 @@ static int decode_frame(AVCodecContext *avctx, · 135 unmodified lines
136 esize = 0;136 esize = 0;
137 }137 }
138 138
139 avctx->pix_fmt = PIX_FMT_PAL8;139 avctx->pix_fmt = AV_PIX_FMT_PAL8;
140 140
141 if (s->width != avctx->width && s->height != avctx->height) {141 if (s->width != avctx->width && s->height != avctx->height) {
142 if (av_image_check_size(s->width, s->height, 0, avctx) < 0)142 if (av_image_check_size(s->width, s->height, 0, avctx) < 0)
libavcodec/pngdec.c+8−8
@@ -463,28 +463,28 @@ static int decode_frame(AVCodecContext *avctx, · 462 unmodified lines
463 463
464 if (s->bit_depth == 8 &&464 if (s->bit_depth == 8 &&
465 s->color_type == PNG_COLOR_TYPE_RGB) {465 s->color_type == PNG_COLOR_TYPE_RGB) {
466 avctx->pix_fmt = PIX_FMT_RGB24;466 avctx->pix_fmt = AV_PIX_FMT_RGB24;
467 } else if (s->bit_depth == 8 &&467 } else if (s->bit_depth == 8 &&
468 s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {468 s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
469 avctx->pix_fmt = PIX_FMT_RGB32;469 avctx->pix_fmt = AV_PIX_FMT_RGB32;
470 } else if (s->bit_depth == 8 &&470 } else if (s->bit_depth == 8 &&
471 s->color_type == PNG_COLOR_TYPE_GRAY) {471 s->color_type == PNG_COLOR_TYPE_GRAY) {
472 avctx->pix_fmt = PIX_FMT_GRAY8;472 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
473 } else if (s->bit_depth == 16 &&473 } else if (s->bit_depth == 16 &&
474 s->color_type == PNG_COLOR_TYPE_GRAY) {474 s->color_type == PNG_COLOR_TYPE_GRAY) {
475 avctx->pix_fmt = PIX_FMT_GRAY16BE;475 avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
476 } else if (s->bit_depth == 16 &&476 } else if (s->bit_depth == 16 &&
477 s->color_type == PNG_COLOR_TYPE_RGB) {477 s->color_type == PNG_COLOR_TYPE_RGB) {
478 avctx->pix_fmt = PIX_FMT_RGB48BE;478 avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
479 } else if (s->bit_depth == 1 &&479 } else if (s->bit_depth == 1 &&
480 s->color_type == PNG_COLOR_TYPE_GRAY) {480 s->color_type == PNG_COLOR_TYPE_GRAY) {
481 avctx->pix_fmt = PIX_FMT_MONOBLACK;481 avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
482 } else if (s->bit_depth == 8 &&482 } else if (s->bit_depth == 8 &&
483 s->color_type == PNG_COLOR_TYPE_PALETTE) {483 s->color_type == PNG_COLOR_TYPE_PALETTE) {
484 avctx->pix_fmt = PIX_FMT_PAL8;484 avctx->pix_fmt = AV_PIX_FMT_PAL8;
485 } else if (s->bit_depth == 8 &&485 } else if (s->bit_depth == 8 &&
486 s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {486 s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
487 avctx->pix_fmt = PIX_FMT_Y400A;487 avctx->pix_fmt = AV_PIX_FMT_Y400A;
488 } else {488 } else {
489 goto fail;489 goto fail;
490 }490 }
libavcodec/pngenc.c+9−9
@@ -249,23 +249,23 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 248 unmodified lines
249 249
250 is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);250 is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
251 switch(avctx->pix_fmt) {251 switch(avctx->pix_fmt) {
252 case PIX_FMT_RGB32:252 case AV_PIX_FMT_RGB32:
253 bit_depth = 8;253 bit_depth = 8;
254 color_type = PNG_COLOR_TYPE_RGB_ALPHA;254 color_type = PNG_COLOR_TYPE_RGB_ALPHA;
255 break;255 break;
256 case PIX_FMT_RGB24:256 case AV_PIX_FMT_RGB24:
257 bit_depth = 8;257 bit_depth = 8;
258 color_type = PNG_COLOR_TYPE_RGB;258 color_type = PNG_COLOR_TYPE_RGB;
259 break;259 break;
260 case PIX_FMT_GRAY8:260 case AV_PIX_FMT_GRAY8:
261 bit_depth = 8;261 bit_depth = 8;
262 color_type = PNG_COLOR_TYPE_GRAY;262 color_type = PNG_COLOR_TYPE_GRAY;
263 break;263 break;
264 case PIX_FMT_MONOBLACK:264 case AV_PIX_FMT_MONOBLACK:
265 bit_depth = 1;265 bit_depth = 1;
266 color_type = PNG_COLOR_TYPE_GRAY;266 color_type = PNG_COLOR_TYPE_GRAY;
267 break;267 break;
268 case PIX_FMT_PAL8:268 case AV_PIX_FMT_PAL8:
269 bit_depth = 8;269 bit_depth = 8;
270 color_type = PNG_COLOR_TYPE_PALETTE;270 color_type = PNG_COLOR_TYPE_PALETTE;
271 break;271 break;
@@ -447,7 +447,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx){ · 175 unmodified lines
447 ff_dsputil_init(&s->dsp, avctx);447 ff_dsputil_init(&s->dsp, avctx);
448 448
449 s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED);449 s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED);
450 if(avctx->pix_fmt == PIX_FMT_MONOBLACK)450 if(avctx->pix_fmt == AV_PIX_FMT_MONOBLACK)
451 s->filter_type = PNG_FILTER_VALUE_NONE;451 s->filter_type = PNG_FILTER_VALUE_NONE;
452 452
453 return 0;453 return 0;
@@ -460,9 +460,9 @@ AVCodec ff_png_encoder = { · 6 unmodified lines
460 .priv_data_size = sizeof(PNGEncContext),460 .priv_data_size = sizeof(PNGEncContext),
461 .init = png_enc_init,461 .init = png_enc_init,
462 .encode2 = encode_frame,462 .encode2 = encode_frame,
463 .pix_fmts = (const enum PixelFormat[]){463 .pix_fmts = (const enum AVPixelFormat[]){
464 PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8,464 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
465 PIX_FMT_MONOBLACK, PIX_FMT_NONE465 AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE
466 },466 },
467 .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),467 .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
468};468};
libavcodec/pnm.c+17−17
@@ -68,14 +68,14 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) · 67 unmodified lines
68 return -1;68 return -1;
69 69
70 if (s->type==1 || s->type==4) {70 if (s->type==1 || s->type==4) {
71 avctx->pix_fmt = PIX_FMT_MONOWHITE;71 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
72 } else if (s->type==2 || s->type==5) {72 } else if (s->type==2 || s->type==5) {
73 if (avctx->codec_id == AV_CODEC_ID_PGMYUV)73 if (avctx->codec_id == AV_CODEC_ID_PGMYUV)
74 avctx->pix_fmt = PIX_FMT_YUV420P;74 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
75 else75 else
76 avctx->pix_fmt = PIX_FMT_GRAY8;76 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
77 } else if (s->type==3 || s->type==6) {77 } else if (s->type==3 || s->type==6) {
78 avctx->pix_fmt = PIX_FMT_RGB24;78 avctx->pix_fmt = AV_PIX_FMT_RGB24;
79 } else if (s->type==7) {79 } else if (s->type==7) {
80 w = -1;80 w = -1;
81 h = -1;81 h = -1;
@@ -114,19 +114,19 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) · 32 unmodified lines
114 avctx->height = h;114 avctx->height = h;
115 if (depth == 1) {115 if (depth == 1) {
116 if (maxval == 1)116 if (maxval == 1)
117 avctx->pix_fmt = PIX_FMT_MONOWHITE;117 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
118 else118 else
119 avctx->pix_fmt = PIX_FMT_GRAY8;119 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
120 } else if (depth == 3) {120 } else if (depth == 3) {
121 if (maxval < 256) {121 if (maxval < 256) {
122 avctx->pix_fmt = PIX_FMT_RGB24;122 avctx->pix_fmt = AV_PIX_FMT_RGB24;
123 } else {123 } else {
124 av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n");124 av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n");
125 avctx->pix_fmt = PIX_FMT_NONE;125 avctx->pix_fmt = AV_PIX_FMT_NONE;
126 return -1;126 return -1;
127 }127 }
128 } else if (depth == 4) {128 } else if (depth == 4) {
129 avctx->pix_fmt = PIX_FMT_RGB32;129 avctx->pix_fmt = AV_PIX_FMT_RGB32;
130 } else {130 } else {
131 return -1;131 return -1;
132 }132 }
@@ -142,7 +142,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) · 9 unmodified lines
142 avctx->height = atoi(buf1);142 avctx->height = atoi(buf1);
143 if(av_image_check_size(avctx->width, avctx->height, 0, avctx))143 if(av_image_check_size(avctx->width, avctx->height, 0, avctx))
144 return -1;144 return -1;
145 if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {145 if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
146 pnm_get(s, buf1, sizeof(buf1));146 pnm_get(s, buf1, sizeof(buf1));
147 s->maxval = atoi(buf1);147 s->maxval = atoi(buf1);
148 if (s->maxval <= 0) {148 if (s->maxval <= 0) {
@@ -150,23 +150,23 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) · 1 unmodified line
150 s->maxval = 255;150 s->maxval = 255;
151 }151 }
152 if (s->maxval >= 256) {152 if (s->maxval >= 256) {
153 if (avctx->pix_fmt == PIX_FMT_GRAY8) {153 if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
154 avctx->pix_fmt = PIX_FMT_GRAY16BE;154 avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
155 if (s->maxval != 65535)155 if (s->maxval != 65535)
156 avctx->pix_fmt = PIX_FMT_GRAY16;156 avctx->pix_fmt = AV_PIX_FMT_GRAY16;
157 } else if (avctx->pix_fmt == PIX_FMT_RGB24) {157 } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
158 if (s->maxval > 255)158 if (s->maxval > 255)
159 avctx->pix_fmt = PIX_FMT_RGB48BE;159 avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
160 } else {160 } else {
161 av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");161 av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
162 avctx->pix_fmt = PIX_FMT_NONE;162 avctx->pix_fmt = AV_PIX_FMT_NONE;
163 return -1;163 return -1;
164 }164 }
165 }165 }
166 }else166 }else
167 s->maxval=1;167 s->maxval=1;
168 /* more check if YUV420 */168 /* more check if YUV420 */
169 if (avctx->pix_fmt == PIX_FMT_YUV420P) {169 if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
170 if ((avctx->width & 1) != 0)170 if ((avctx->width & 1) != 0)
171 return -1;171 return -1;
172 h = (avctx->height * 2);172 h = (avctx->height * 2);
libavcodec/pnmdec.c+9−9
@@ -58,33 +58,33 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, · 57 unmodified lines
58 switch (avctx->pix_fmt) {58 switch (avctx->pix_fmt) {
59 default:59 default:
60 return -1;60 return -1;
61 case PIX_FMT_RGB48BE:61 case AV_PIX_FMT_RGB48BE:
62 n = avctx->width * 6;62 n = avctx->width * 6;
63 components=3;63 components=3;
64 sample_len=16;64 sample_len=16;
65 goto do_read;65 goto do_read;
66 case PIX_FMT_RGB24:66 case AV_PIX_FMT_RGB24:
67 n = avctx->width * 3;67 n = avctx->width * 3;
68 components=3;68 components=3;
69 sample_len=8;69 sample_len=8;
70 goto do_read;70 goto do_read;
71 case PIX_FMT_GRAY8:71 case AV_PIX_FMT_GRAY8:
72 n = avctx->width;72 n = avctx->width;
73 components=1;73 components=1;
74 sample_len=8;74 sample_len=8;
75 if (s->maxval < 255)75 if (s->maxval < 255)
76 upgrade = 1;76 upgrade = 1;
77 goto do_read;77 goto do_read;
78 case PIX_FMT_GRAY16BE:78 case AV_PIX_FMT_GRAY16BE:
79 case PIX_FMT_GRAY16LE:79 case AV_PIX_FMT_GRAY16LE:
80 n = avctx->width * 2;80 n = avctx->width * 2;
81 components=1;81 components=1;
82 sample_len=16;82 sample_len=16;
83 if (s->maxval < 65535)83 if (s->maxval < 65535)
84 upgrade = 2;84 upgrade = 2;
85 goto do_read;85 goto do_read;
86 case PIX_FMT_MONOWHITE:86 case AV_PIX_FMT_MONOWHITE:
87 case PIX_FMT_MONOBLACK:87 case AV_PIX_FMT_MONOBLACK:
88 n = (avctx->width + 7) >> 3;88 n = (avctx->width + 7) >> 3;
89 components=1;89 components=1;
90 sample_len=1;90 sample_len=1;
@@ -133,7 +133,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, · 42 unmodified lines
133 }133 }
134 }134 }
135 break;135 break;
136 case PIX_FMT_YUV420P:136 case AV_PIX_FMT_YUV420P:
137 {137 {
138 unsigned char *ptr1, *ptr2;138 unsigned char *ptr1, *ptr2;
139 139
@@ -161,7 +161,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, · 21 unmodified lines
161 }161 }
162 }162 }
163 break;163 break;
164 case PIX_FMT_RGB32:164 case AV_PIX_FMT_RGB32:
165 ptr = p->data[0];165 ptr = p->data[0];
166 linesize = p->linesize[0];166 linesize = p->linesize[0];
167 if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)167 if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)
libavcodec/pnmenc.c+16−16
@@ -51,27 +51,27 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 50 unmodified lines
51 h = avctx->height;51 h = avctx->height;
52 h1 = h;52 h1 = h;
53 switch (avctx->pix_fmt) {53 switch (avctx->pix_fmt) {
54 case PIX_FMT_MONOWHITE:54 case AV_PIX_FMT_MONOWHITE:
55 c = '4';55 c = '4';
56 n = (avctx->width + 7) >> 3;56 n = (avctx->width + 7) >> 3;
57 break;57 break;
58 case PIX_FMT_GRAY8:58 case AV_PIX_FMT_GRAY8:
59 c = '5';59 c = '5';
60 n = avctx->width;60 n = avctx->width;
61 break;61 break;
62 case PIX_FMT_GRAY16BE:62 case AV_PIX_FMT_GRAY16BE:
63 c = '5';63 c = '5';
64 n = avctx->width * 2;64 n = avctx->width * 2;
65 break;65 break;
66 case PIX_FMT_RGB24:66 case AV_PIX_FMT_RGB24:
67 c = '6';67 c = '6';
68 n = avctx->width * 3;68 n = avctx->width * 3;
69 break;69 break;
70 case PIX_FMT_RGB48BE:70 case AV_PIX_FMT_RGB48BE:
71 c = '6';71 c = '6';
72 n = avctx->width * 6;72 n = avctx->width * 6;
73 break;73 break;
74 case PIX_FMT_YUV420P:74 case AV_PIX_FMT_YUV420P:
75 c = '5';75 c = '5';
76 n = avctx->width;76 n = avctx->width;
77 h1 = (h * 3) / 2;77 h1 = (h * 3) / 2;
@@ -82,9 +82,9 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 4 unmodified lines
82 snprintf(s->bytestream, s->bytestream_end - s->bytestream,82 snprintf(s->bytestream, s->bytestream_end - s->bytestream,
83 "P%c\n%d %d\n", c, avctx->width, h1);83 "P%c\n%d %d\n", c, avctx->width, h1);
84 s->bytestream += strlen(s->bytestream);84 s->bytestream += strlen(s->bytestream);
85 if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {85 if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
86 snprintf(s->bytestream, s->bytestream_end - s->bytestream,86 snprintf(s->bytestream, s->bytestream_end - s->bytestream,
87 "%d\n", (avctx->pix_fmt != PIX_FMT_GRAY16BE && avctx->pix_fmt != PIX_FMT_RGB48BE) ? 255 : 65535);87 "%d\n", (avctx->pix_fmt != AV_PIX_FMT_GRAY16BE && avctx->pix_fmt != AV_PIX_FMT_RGB48BE) ? 255 : 65535);
88 s->bytestream += strlen(s->bytestream);88 s->bytestream += strlen(s->bytestream);
89 }89 }
90 90
@@ -96,7 +96,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 5 unmodified lines
96 ptr += linesize;96 ptr += linesize;
97 }97 }
98 98
99 if (avctx->pix_fmt == PIX_FMT_YUV420P) {99 if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
100 h >>= 1;100 h >>= 1;
101 n >>= 1;101 n >>= 1;
102 ptr1 = p->data[1];102 ptr1 = p->data[1];
@@ -126,8 +126,8 @@ AVCodec ff_pgm_encoder = { · 23 unmodified lines
126 .priv_data_size = sizeof(PNMContext),126 .priv_data_size = sizeof(PNMContext),
127 .init = ff_pnm_init,127 .init = ff_pnm_init,
128 .encode2 = pnm_encode_frame,128 .encode2 = pnm_encode_frame,
129 .pix_fmts = (const enum PixelFormat[]){129 .pix_fmts = (const enum AVPixelFormat[]){
130 PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE130 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE
131 },131 },
132 .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),132 .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
133};133};
@@ -141,7 +141,7 @@ AVCodec ff_pgmyuv_encoder = { · 7 unmodified lines
141 .priv_data_size = sizeof(PNMContext),141 .priv_data_size = sizeof(PNMContext),
142 .init = ff_pnm_init,142 .init = ff_pnm_init,
143 .encode2 = pnm_encode_frame,143 .encode2 = pnm_encode_frame,
144 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },144 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
145 .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),145 .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
146};146};
147#endif147#endif
@@ -154,8 +154,8 @@ AVCodec ff_ppm_encoder = { · 6 unmodified lines
154 .priv_data_size = sizeof(PNMContext),154 .priv_data_size = sizeof(PNMContext),
155 .init = ff_pnm_init,155 .init = ff_pnm_init,
156 .encode2 = pnm_encode_frame,156 .encode2 = pnm_encode_frame,
157 .pix_fmts = (const enum PixelFormat[]){157 .pix_fmts = (const enum AVPixelFormat[]){
158 PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE158 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE
159 },159 },
160 .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),160 .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
161};161};
@@ -169,8 +169,8 @@ AVCodec ff_pbm_encoder = { · 7 unmodified lines
169 .priv_data_size = sizeof(PNMContext),169 .priv_data_size = sizeof(PNMContext),
170 .init = ff_pnm_init,170 .init = ff_pnm_init,
171 .encode2 = pnm_encode_frame,171 .encode2 = pnm_encode_frame,
172 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_MONOWHITE,172 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE,
173 PIX_FMT_NONE },173 AV_PIX_FMT_NONE },
174 .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),174 .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
175};175};
176#endif176#endif
libavcodec/proresdec.c+2−2
@@ -139,10 +139,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, · 138 unmodified lines
139 ctx->num_chroma_blocks = (1 << ctx->chroma_factor) >> 1;139 ctx->num_chroma_blocks = (1 << ctx->chroma_factor) >> 1;
140 switch (ctx->chroma_factor) {140 switch (ctx->chroma_factor) {
141 case 2:141 case 2:
142 avctx->pix_fmt = PIX_FMT_YUV422P10;142 avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
143 break;143 break;
144 case 3:144 case 3:
145 avctx->pix_fmt = PIX_FMT_YUV444P10;145 avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
146 break;146 break;
147 default:147 default:
148 av_log(avctx, AV_LOG_ERROR,148 av_log(avctx, AV_LOG_ERROR,
libavcodec/proresenc.c+4−4
@@ -33,7 +33,7 @@ · 32 unmodified lines
33 33
34#define MAX_MBS_PER_SLICE 834#define MAX_MBS_PER_SLICE 8
35 35
36#define MAX_PLANES 3 // should be increased to 4 when there's PIX_FMT_YUV444AP1036#define MAX_PLANES 3 // should be increased to 4 when there's AV_PIX_FMT_YUV444AP10
37 37
38enum {38enum {
39 PRORES_PROFILE_PROXY = 0,39 PRORES_PROFILE_PROXY = 0,
@@ -904,7 +904,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 864 unmodified lines
904 return AVERROR(EINVAL);904 return AVERROR(EINVAL);
905 }905 }
906 906
907 ctx->chroma_factor = avctx->pix_fmt == PIX_FMT_YUV422P10907 ctx->chroma_factor = avctx->pix_fmt == AV_PIX_FMT_YUV422P10
908 ? CFACTOR_Y422908 ? CFACTOR_Y422
909 : CFACTOR_Y444;909 : CFACTOR_Y444;
910 ctx->profile_info = prores_profile_info + ctx->profile;910 ctx->profile_info = prores_profile_info + ctx->profile;
@@ -1071,8 +1071,8 @@ AVCodec ff_prores_encoder = { · 160 unmodified lines
1071 .encode2 = encode_frame,1071 .encode2 = encode_frame,
1072 .capabilities = CODEC_CAP_SLICE_THREADS,1072 .capabilities = CODEC_CAP_SLICE_THREADS,
1073 .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),1073 .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
1074 .pix_fmts = (const enum PixelFormat[]) {1074 .pix_fmts = (const enum AVPixelFormat[]) {
1075 PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, PIX_FMT_NONE1075 AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE
1076 },1076 },
1077 .priv_class = &proresenc_class,1077 .priv_class = &proresenc_class,
1078};1078};
libavcodec/ptx.c+1−1
@@ -59,7 +59,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 58 unmodified lines
59 return -1;59 return -1;
60 }60 }
61 61
62 avctx->pix_fmt = PIX_FMT_RGB555;62 avctx->pix_fmt = AV_PIX_FMT_RGB555;
63 63
64 if (buf_end - buf < offset)64 if (buf_end - buf < offset)
65 return AVERROR_INVALIDDATA;65 return AVERROR_INVALIDDATA;
libavcodec/qdrw.c+1−1
@@ -148,7 +148,7 @@ static int decode_frame(AVCodecContext *avctx, · 147 unmodified lines
148static av_cold int decode_init(AVCodecContext *avctx){148static av_cold int decode_init(AVCodecContext *avctx){
149// QdrawContext * const a = avctx->priv_data;149// QdrawContext * const a = avctx->priv_data;
150 150
151 avctx->pix_fmt= PIX_FMT_PAL8;151 avctx->pix_fmt= AV_PIX_FMT_PAL8;
152 152
153 return 0;153 return 0;
154}154}
libavcodec/qpeg.c+1−1
@@ -290,7 +290,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ · 289 unmodified lines
290 QpegContext * const a = avctx->priv_data;290 QpegContext * const a = avctx->priv_data;
291 291
292 a->avctx = avctx;292 a->avctx = avctx;
293 avctx->pix_fmt= PIX_FMT_PAL8;293 avctx->pix_fmt= AV_PIX_FMT_PAL8;
294 a->refdata = av_malloc(avctx->width * avctx->height);294 a->refdata = av_malloc(avctx->width * avctx->height);
295 295
296 return 0;296 return 0;
libavcodec/qtrle.c+5−5
@@ -346,7 +346,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) · 345 unmodified lines
346 switch (avctx->bits_per_coded_sample) {346 switch (avctx->bits_per_coded_sample) {
347 case 1:347 case 1:
348 case 33:348 case 33:
349 avctx->pix_fmt = PIX_FMT_MONOWHITE;349 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
350 break;350 break;
351 351
352 case 2:352 case 2:
@@ -355,19 +355,19 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) · 2 unmodified lines
355 case 34:355 case 34:
356 case 36:356 case 36:
357 case 40:357 case 40:
358 avctx->pix_fmt = PIX_FMT_PAL8;358 avctx->pix_fmt = AV_PIX_FMT_PAL8;
359 break;359 break;
360 360
361 case 16:361 case 16:
362 avctx->pix_fmt = PIX_FMT_RGB555;362 avctx->pix_fmt = AV_PIX_FMT_RGB555;
363 break;363 break;
364 364
365 case 24:365 case 24:
366 avctx->pix_fmt = PIX_FMT_RGB24;366 avctx->pix_fmt = AV_PIX_FMT_RGB24;
367 break;367 break;
368 368
369 case 32:369 case 32:
370 avctx->pix_fmt = PIX_FMT_RGB32;370 avctx->pix_fmt = AV_PIX_FMT_RGB32;
371 break;371 break;
372 372
373 default:373 default:
libavcodec/qtrleenc.c+5−5
@@ -70,13 +70,13 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx) · 69 unmodified lines
70 s->avctx=avctx;70 s->avctx=avctx;
71 71
72 switch (avctx->pix_fmt) {72 switch (avctx->pix_fmt) {
73 case PIX_FMT_RGB555BE:73 case AV_PIX_FMT_RGB555BE:
74 s->pixel_size = 2;74 s->pixel_size = 2;
75 break;75 break;
76 case PIX_FMT_RGB24:76 case AV_PIX_FMT_RGB24:
77 s->pixel_size = 3;77 s->pixel_size = 3;
78 break;78 break;
79 case PIX_FMT_ARGB:79 case AV_PIX_FMT_ARGB:
80 s->pixel_size = 4;80 s->pixel_size = 4;
81 break;81 break;
82 default:82 default:
@@ -335,8 +335,8 @@ AVCodec ff_qtrle_encoder = { · 252 unmodified lines
335 .init = qtrle_encode_init,335 .init = qtrle_encode_init,
336 .encode2 = qtrle_encode_frame,336 .encode2 = qtrle_encode_frame,
337 .close = qtrle_encode_end,337 .close = qtrle_encode_end,
338 .pix_fmts = (const enum PixelFormat[]){338 .pix_fmts = (const enum AVPixelFormat[]){
339 PIX_FMT_RGB24, PIX_FMT_RGB555BE, PIX_FMT_ARGB, PIX_FMT_NONE339 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE
340 },340 },
341 .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),341 .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
342};342};
libavcodec/r210dec.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27static av_cold int decode_init(AVCodecContext *avctx)27static av_cold int decode_init(AVCodecContext *avctx)
28{28{
29 avctx->pix_fmt = PIX_FMT_RGB48;29 avctx->pix_fmt = AV_PIX_FMT_RGB48;
30 avctx->bits_per_raw_sample = 10;30 avctx->bits_per_raw_sample = 10;
31 31
32 avctx->coded_frame = avcodec_alloc_frame();32 avctx->coded_frame = avcodec_alloc_frame();
libavcodec/raw.c+108−108
@@ -29,126 +29,126 @@ · 28 unmodified lines
29#include "libavutil/common.h"29#include "libavutil/common.h"
30 30
31const PixelFormatTag ff_raw_pix_fmt_tags[] = {31const PixelFormatTag ff_raw_pix_fmt_tags[] = {
32 { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */32 { AV_PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
33 { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },33 { AV_PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') },
34 { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },34 { AV_PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') },
35 { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },35 { AV_PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') },
36 { PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },36 { AV_PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') },
37 { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },37 { AV_PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') },
38 { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },38 { AV_PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
39 { PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },39 { AV_PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },
40 { PIX_FMT_YUV422P, MKTAG('Y', 'V', '1', '6') },40 { AV_PIX_FMT_YUV422P, MKTAG('Y', 'V', '1', '6') },
41 /* yuvjXXX formats are deprecated hacks specific to libav*,41 /* yuvjXXX formats are deprecated hacks specific to libav*,
42 they are identical to yuvXXX */42 they are identical to yuvXXX */
43 { PIX_FMT_YUVJ420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */43 { AV_PIX_FMT_YUVJ420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
44 { PIX_FMT_YUVJ420P, MKTAG('I', 'Y', 'U', 'V') },44 { AV_PIX_FMT_YUVJ420P, MKTAG('I', 'Y', 'U', 'V') },
45 { PIX_FMT_YUVJ420P, MKTAG('Y', 'V', '1', '2') },45 { AV_PIX_FMT_YUVJ420P, MKTAG('Y', 'V', '1', '2') },
46 { PIX_FMT_YUVJ422P, MKTAG('Y', '4', '2', 'B') },46 { AV_PIX_FMT_YUVJ422P, MKTAG('Y', '4', '2', 'B') },
47 { PIX_FMT_YUVJ422P, MKTAG('P', '4', '2', '2') },47 { AV_PIX_FMT_YUVJ422P, MKTAG('P', '4', '2', '2') },
48 { PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') },48 { AV_PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') },
49 { PIX_FMT_GRAY8, MKTAG('Y', '8', ' ', ' ') },49 { AV_PIX_FMT_GRAY8, MKTAG('Y', '8', ' ', ' ') },
50 50
51 { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */51 { AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */
52 { PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') },52 { AV_PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') },
53 { PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },53 { AV_PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') },
54 { PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },54 { AV_PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') },
55 { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },55 { AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') },
56 { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },56 { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') },
57 { PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },57 { AV_PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') },
58 { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },58 { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') },
59 { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') },59 { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') },
60 { PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') },60 { AV_PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') },
61 { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') },61 { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') },
62 { PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */62 { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */
63 { PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */63 { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */
64 { PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') },64 { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') },
65 { PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */65 { AV_PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */
66 { PIX_FMT_UYVY422, MKTAG('a', 'u', 'v', '2') },66 { AV_PIX_FMT_UYVY422, MKTAG('a', 'u', 'v', '2') },
67 { PIX_FMT_UYYVYY411, MKTAG('Y', '4', '1', '1') },67 { AV_PIX_FMT_UYYVYY411, MKTAG('Y', '4', '1', '1') },
68 { PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') },68 { AV_PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') },
69 { PIX_FMT_NV12, MKTAG('N', 'V', '1', '2') },69 { AV_PIX_FMT_NV12, MKTAG('N', 'V', '1', '2') },
70 { PIX_FMT_NV21, MKTAG('N', 'V', '2', '1') },70 { AV_PIX_FMT_NV21, MKTAG('N', 'V', '2', '1') },
71 71
72 /* nut */72 /* nut */
73 { PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },73 { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },
74 { PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) },74 { AV_PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) },
75 { PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) },75 { AV_PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) },
76 { PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) },76 { AV_PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) },
77 { PIX_FMT_RGB555BE, MKTAG(15 , 'B', 'G', 'R') },77 { AV_PIX_FMT_RGB555BE, MKTAG(15 , 'B', 'G', 'R') },
78 { PIX_FMT_BGR555BE, MKTAG(15 , 'R', 'G', 'B') },78 { AV_PIX_FMT_BGR555BE, MKTAG(15 , 'R', 'G', 'B') },
79 { PIX_FMT_RGB565BE, MKTAG(16 , 'B', 'G', 'R') },79 { AV_PIX_FMT_RGB565BE, MKTAG(16 , 'B', 'G', 'R') },
80 { PIX_FMT_BGR565BE, MKTAG(16 , 'R', 'G', 'B') },80 { AV_PIX_FMT_BGR565BE, MKTAG(16 , 'R', 'G', 'B') },
81 { PIX_FMT_RGB444LE, MKTAG('R', 'G', 'B', 12) },81 { AV_PIX_FMT_RGB444LE, MKTAG('R', 'G', 'B', 12) },
82 { PIX_FMT_BGR444LE, MKTAG('B', 'G', 'R', 12) },82 { AV_PIX_FMT_BGR444LE, MKTAG('B', 'G', 'R', 12) },
83 { PIX_FMT_RGB444BE, MKTAG(12 , 'B', 'G', 'R') },83 { AV_PIX_FMT_RGB444BE, MKTAG(12 , 'B', 'G', 'R') },
84 { PIX_FMT_BGR444BE, MKTAG(12 , 'R', 'G', 'B') },84 { AV_PIX_FMT_BGR444BE, MKTAG(12 , 'R', 'G', 'B') },
85 { PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') },85 { AV_PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') },
86 { PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') },86 { AV_PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') },
87 { PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },87 { AV_PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },
88 { PIX_FMT_ARGB, MKTAG('A', 'R', 'G', 'B') },88 { AV_PIX_FMT_ARGB, MKTAG('A', 'R', 'G', 'B') },
89 { PIX_FMT_RGB24, MKTAG('R', 'G', 'B', 24 ) },89 { AV_PIX_FMT_RGB24, MKTAG('R', 'G', 'B', 24 ) },
90 { PIX_FMT_BGR24, MKTAG('B', 'G', 'R', 24 ) },90 { AV_PIX_FMT_BGR24, MKTAG('B', 'G', 'R', 24 ) },
91 { PIX_FMT_YUV411P, MKTAG('4', '1', '1', 'P') },91 { AV_PIX_FMT_YUV411P, MKTAG('4', '1', '1', 'P') },
92 { PIX_FMT_YUV422P, MKTAG('4', '2', '2', 'P') },92 { AV_PIX_FMT_YUV422P, MKTAG('4', '2', '2', 'P') },
93 { PIX_FMT_YUVJ422P, MKTAG('4', '2', '2', 'P') },93 { AV_PIX_FMT_YUVJ422P, MKTAG('4', '2', '2', 'P') },
94 { PIX_FMT_YUV440P, MKTAG('4', '4', '0', 'P') },94 { AV_PIX_FMT_YUV440P, MKTAG('4', '4', '0', 'P') },
95 { PIX_FMT_YUVJ440P, MKTAG('4', '4', '0', 'P') },95 { AV_PIX_FMT_YUVJ440P, MKTAG('4', '4', '0', 'P') },
96 { PIX_FMT_YUV444P, MKTAG('4', '4', '4', 'P') },96 { AV_PIX_FMT_YUV444P, MKTAG('4', '4', '4', 'P') },
97 { PIX_FMT_YUVJ444P, MKTAG('4', '4', '4', 'P') },97 { AV_PIX_FMT_YUVJ444P, MKTAG('4', '4', '4', 'P') },
98 { PIX_FMT_MONOWHITE,MKTAG('B', '1', 'W', '0') },98 { AV_PIX_FMT_MONOWHITE,MKTAG('B', '1', 'W', '0') },
99 { PIX_FMT_MONOBLACK,MKTAG('B', '0', 'W', '1') },99 { AV_PIX_FMT_MONOBLACK,MKTAG('B', '0', 'W', '1') },
100 { PIX_FMT_BGR8, MKTAG('B', 'G', 'R', 8 ) },100 { AV_PIX_FMT_BGR8, MKTAG('B', 'G', 'R', 8 ) },
101 { PIX_FMT_RGB8, MKTAG('R', 'G', 'B', 8 ) },101 { AV_PIX_FMT_RGB8, MKTAG('R', 'G', 'B', 8 ) },
102 { PIX_FMT_BGR4, MKTAG('B', 'G', 'R', 4 ) },102 { AV_PIX_FMT_BGR4, MKTAG('B', 'G', 'R', 4 ) },
103 { PIX_FMT_RGB4, MKTAG('R', 'G', 'B', 4 ) },103 { AV_PIX_FMT_RGB4, MKTAG('R', 'G', 'B', 4 ) },
104 { PIX_FMT_RGB4_BYTE,MKTAG('B', '4', 'B', 'Y') },104 { AV_PIX_FMT_RGB4_BYTE,MKTAG('B', '4', 'B', 'Y') },
105 { PIX_FMT_BGR4_BYTE,MKTAG('R', '4', 'B', 'Y') },105 { AV_PIX_FMT_BGR4_BYTE,MKTAG('R', '4', 'B', 'Y') },
106 { PIX_FMT_RGB48LE, MKTAG('R', 'G', 'B', 48 ) },106 { AV_PIX_FMT_RGB48LE, MKTAG('R', 'G', 'B', 48 ) },
107 { PIX_FMT_RGB48BE, MKTAG( 48, 'R', 'G', 'B') },107 { AV_PIX_FMT_RGB48BE, MKTAG( 48, 'R', 'G', 'B') },
108 { PIX_FMT_BGR48LE, MKTAG('B', 'G', 'R', 48 ) },108 { AV_PIX_FMT_BGR48LE, MKTAG('B', 'G', 'R', 48 ) },
109 { PIX_FMT_BGR48BE, MKTAG( 48, 'B', 'G', 'R') },109 { AV_PIX_FMT_BGR48BE, MKTAG( 48, 'B', 'G', 'R') },
110 { PIX_FMT_GRAY16LE, MKTAG('Y', '1', 0 , 16 ) },110 { AV_PIX_FMT_GRAY16LE, MKTAG('Y', '1', 0 , 16 ) },
111 { PIX_FMT_GRAY16BE, MKTAG(16 , 0 , '1', 'Y') },111 { AV_PIX_FMT_GRAY16BE, MKTAG(16 , 0 , '1', 'Y') },
112 { PIX_FMT_YUV420P10LE, MKTAG('Y', '3', 11 , 10 ) },112 { AV_PIX_FMT_YUV420P10LE, MKTAG('Y', '3', 11 , 10 ) },
113 { PIX_FMT_YUV420P10BE, MKTAG(10 , 11 , '3', 'Y') },113 { AV_PIX_FMT_YUV420P10BE, MKTAG(10 , 11 , '3', 'Y') },
114 { PIX_FMT_YUV422P10LE, MKTAG('Y', '3', 10 , 10 ) },114 { AV_PIX_FMT_YUV422P10LE, MKTAG('Y', '3', 10 , 10 ) },
115 { PIX_FMT_YUV422P10BE, MKTAG(10 , 10 , '3', 'Y') },115 { AV_PIX_FMT_YUV422P10BE, MKTAG(10 , 10 , '3', 'Y') },
116 { PIX_FMT_YUV444P10LE, MKTAG('Y', '3', 0 , 10 ) },116 { AV_PIX_FMT_YUV444P10LE, MKTAG('Y', '3', 0 , 10 ) },
117 { PIX_FMT_YUV444P10BE, MKTAG(10 , 0 , '3', 'Y') },117 { AV_PIX_FMT_YUV444P10BE, MKTAG(10 , 0 , '3', 'Y') },
118 { PIX_FMT_YUV420P16LE, MKTAG('Y', '3', 11 , 16 ) },118 { AV_PIX_FMT_YUV420P16LE, MKTAG('Y', '3', 11 , 16 ) },
119 { PIX_FMT_YUV420P16BE, MKTAG(16 , 11 , '3', 'Y') },119 { AV_PIX_FMT_YUV420P16BE, MKTAG(16 , 11 , '3', 'Y') },
120 { PIX_FMT_YUV422P16LE, MKTAG('Y', '3', 10 , 16 ) },120 { AV_PIX_FMT_YUV422P16LE, MKTAG('Y', '3', 10 , 16 ) },
121 { PIX_FMT_YUV422P16BE, MKTAG(16 , 10 , '3', 'Y') },121 { AV_PIX_FMT_YUV422P16BE, MKTAG(16 , 10 , '3', 'Y') },
122 { PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) },122 { AV_PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) },
123 { PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') },123 { AV_PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') },
124 { PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) },124 { AV_PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) },
125 { PIX_FMT_Y400A, MKTAG('Y', '2', 0 , 8 ) },125 { AV_PIX_FMT_Y400A, MKTAG('Y', '2', 0 , 8 ) },
126 126
127 /* quicktime */127 /* quicktime */
128 { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },128 { AV_PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
129 { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') },129 { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') },
130 { PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */130 { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
131 { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },131 { AV_PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
132 { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },132 { AV_PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },
133 { PIX_FMT_YUYV422, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */133 { AV_PIX_FMT_YUYV422, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */
134 { PIX_FMT_RGB555LE,MKTAG('L', '5', '5', '5') },134 { AV_PIX_FMT_RGB555LE,MKTAG('L', '5', '5', '5') },
135 { PIX_FMT_RGB565LE,MKTAG('L', '5', '6', '5') },135 { AV_PIX_FMT_RGB565LE,MKTAG('L', '5', '6', '5') },
136 { PIX_FMT_RGB565BE,MKTAG('B', '5', '6', '5') },136 { AV_PIX_FMT_RGB565BE,MKTAG('B', '5', '6', '5') },
137 { PIX_FMT_BGR24, MKTAG('2', '4', 'B', 'G') },137 { AV_PIX_FMT_BGR24, MKTAG('2', '4', 'B', 'G') },
138 { PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') },138 { AV_PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') },
139 { PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') },139 { AV_PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') },
140 { PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },140 { AV_PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },
141 { PIX_FMT_GRAY16BE,MKTAG('b', '1', '6', 'g') },141 { AV_PIX_FMT_GRAY16BE,MKTAG('b', '1', '6', 'g') },
142 { PIX_FMT_RGB48BE, MKTAG('b', '4', '8', 'r') },142 { AV_PIX_FMT_RGB48BE, MKTAG('b', '4', '8', 'r') },
143 143
144 /* special */144 /* special */
145 { PIX_FMT_RGB565LE,MKTAG( 3 , 0 , 0 , 0 ) }, /* flipped RGB565LE */145 { AV_PIX_FMT_RGB565LE,MKTAG( 3 , 0 , 0 , 0 ) }, /* flipped RGB565LE */
146 { PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */146 { AV_PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */
147 147
148 { PIX_FMT_NONE, 0 },148 { AV_PIX_FMT_NONE, 0 },
149};149};
150 150
151unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt)151unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt)
152{152{
153 const PixelFormatTag *tags = ff_raw_pix_fmt_tags;153 const PixelFormatTag *tags = ff_raw_pix_fmt_tags;
154 while (tags->pix_fmt >= 0) {154 while (tags->pix_fmt >= 0) {
libavcodec/raw.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include "avcodec.h"30#include "avcodec.h"
31 31
32typedef struct PixelFormatTag {32typedef struct PixelFormatTag {
33 enum PixelFormat pix_fmt;33 enum AVPixelFormat pix_fmt;
34 unsigned int fourcc;34 unsigned int fourcc;
35} PixelFormatTag;35} PixelFormatTag;
36 36
libavcodec/rawdec.c+26−26
@@ -39,38 +39,38 @@ typedef struct RawVideoContext { · 38 unmodified lines
39} RawVideoContext;39} RawVideoContext;
40 40
41static const PixelFormatTag pix_fmt_bps_avi[] = {41static const PixelFormatTag pix_fmt_bps_avi[] = {
42 { PIX_FMT_PAL8, 4 },42 { AV_PIX_FMT_PAL8, 4 },
43 { PIX_FMT_PAL8, 8 },43 { AV_PIX_FMT_PAL8, 8 },
44 { PIX_FMT_RGB444, 12 },44 { AV_PIX_FMT_RGB444, 12 },
45 { PIX_FMT_RGB555, 15 },45 { AV_PIX_FMT_RGB555, 15 },
46 { PIX_FMT_RGB555, 16 },46 { AV_PIX_FMT_RGB555, 16 },
47 { PIX_FMT_BGR24, 24 },47 { AV_PIX_FMT_BGR24, 24 },
48 { PIX_FMT_RGB32, 32 },48 { AV_PIX_FMT_RGB32, 32 },
49 { PIX_FMT_NONE, 0 },49 { AV_PIX_FMT_NONE, 0 },
50};50};
51 51
52static const PixelFormatTag pix_fmt_bps_mov[] = {52static const PixelFormatTag pix_fmt_bps_mov[] = {
53 { PIX_FMT_MONOWHITE, 1 },53 { AV_PIX_FMT_MONOWHITE, 1 },
54 { PIX_FMT_PAL8, 2 },54 { AV_PIX_FMT_PAL8, 2 },
55 { PIX_FMT_PAL8, 4 },55 { AV_PIX_FMT_PAL8, 4 },
56 { PIX_FMT_PAL8, 8 },56 { AV_PIX_FMT_PAL8, 8 },
57 // FIXME swscale does not support 16 bit in .mov, sample 16bit.mov57 // FIXME swscale does not support 16 bit in .mov, sample 16bit.mov
58 // http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html58 // http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
59 { PIX_FMT_RGB555BE, 16 },59 { AV_PIX_FMT_RGB555BE, 16 },
60 { PIX_FMT_RGB24, 24 },60 { AV_PIX_FMT_RGB24, 24 },
61 { PIX_FMT_ARGB, 32 },61 { AV_PIX_FMT_ARGB, 32 },
62 { PIX_FMT_MONOWHITE,33 },62 { AV_PIX_FMT_MONOWHITE,33 },
63 { PIX_FMT_NONE, 0 },63 { AV_PIX_FMT_NONE, 0 },
64};64};
65 65
66static enum PixelFormat find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)66static enum AVPixelFormat find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)
67{67{
68 while (tags->pix_fmt >= 0) {68 while (tags->pix_fmt >= 0) {
69 if (tags->fourcc == fourcc)69 if (tags->fourcc == fourcc)
70 return tags->pix_fmt;70 return tags->pix_fmt;
71 tags++;71 tags++;
72 }72 }
73 return PIX_FMT_YUV420P;73 return AV_PIX_FMT_YUV420P;
74}74}
75 75
76static av_cold int raw_init_decoder(AVCodecContext *avctx)76static av_cold int raw_init_decoder(AVCodecContext *avctx)
@@ -83,13 +83,13 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) · 6 unmodified lines
83 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);83 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
84 else if (avctx->codec_tag)84 else if (avctx->codec_tag)
85 avctx->pix_fmt = find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);85 avctx->pix_fmt = find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);
86 else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)86 else if (avctx->pix_fmt == AV_PIX_FMT_NONE && avctx->bits_per_coded_sample)
87 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);87 avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
88 88
89 ff_set_systematic_pal2(context->palette, avctx->pix_fmt);89 ff_set_systematic_pal2(context->palette, avctx->pix_fmt);
90 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);90 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
91 if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&91 if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) &&
92 avctx->pix_fmt==PIX_FMT_PAL8 &&92 avctx->pix_fmt==AV_PIX_FMT_PAL8 &&
93 (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){93 (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){
94 context->buffer = av_malloc(context->length);94 context->buffer = av_malloc(context->length);
95 if (!context->buffer)95 if (!context->buffer)
@@ -130,7 +130,7 @@ static int raw_decode(AVCodecContext *avctx, · 34 unmodified lines
130 frame->reordered_opaque = avctx->reordered_opaque;130 frame->reordered_opaque = avctx->reordered_opaque;
131 frame->pkt_pts = avctx->pkt->pts;131 frame->pkt_pts = avctx->pkt->pts;
132 132
133 if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0))133 if(buf_size < context->length - (avctx->pix_fmt==AV_PIX_FMT_PAL8 ? 256*4 : 0))
134 return -1;134 return -1;
135 135
136 //2bpp and 4bpp raw in avi and mov (yes this is ugly ...)136 //2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
@@ -160,11 +160,11 @@ static int raw_decode(AVCodecContext *avctx, · 23 unmodified lines
160 if ((res = avpicture_fill(picture, buf, avctx->pix_fmt,160 if ((res = avpicture_fill(picture, buf, avctx->pix_fmt,
161 avctx->width, avctx->height)) < 0)161 avctx->width, avctx->height)) < 0)
162 return res;162 return res;
163 if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) ||163 if((avctx->pix_fmt==AV_PIX_FMT_PAL8 && buf_size < context->length) ||
164 (av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) {164 (av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) {
165 frame->data[1]= context->palette;165 frame->data[1]= context->palette;
166 }166 }
167 if (avctx->pix_fmt == PIX_FMT_PAL8) {167 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
168 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);168 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
169 169
170 if (pal) {170 if (pal) {
@@ -172,7 +172,7 @@ static int raw_decode(AVCodecContext *avctx, · 1 unmodified line
172 frame->palette_has_changed = 1;172 frame->palette_has_changed = 1;
173 }173 }
174 }174 }
175 if(avctx->pix_fmt==PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)175 if(avctx->pix_fmt==AV_PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
176 frame->linesize[0] = (frame->linesize[0]+3)&~3;176 frame->linesize[0] = (frame->linesize[0]+3)&~3;
177 177
178 if(context->flip)178 if(context->flip)
@@ -185,7 +185,7 @@ static int raw_decode(AVCodecContext *avctx, · 6 unmodified lines
185 FFSWAP(uint8_t *, picture->data[1], picture->data[2]);185 FFSWAP(uint8_t *, picture->data[1], picture->data[2]);
186 186
187 if(avctx->codec_tag == AV_RL32("yuv2") &&187 if(avctx->codec_tag == AV_RL32("yuv2") &&
188 avctx->pix_fmt == PIX_FMT_YUYV422) {188 avctx->pix_fmt == AV_PIX_FMT_YUYV422) {
189 int x, y;189 int x, y;
190 uint8_t *line = picture->data[0];190 uint8_t *line = picture->data[0];
191 for(y = 0; y < avctx->height; y++) {191 for(y = 0; y < avctx->height; y++) {
libavcodec/rawenc.c+1−1
@@ -57,7 +57,7 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt, · 56 unmodified lines
57 return ret;57 return ret;
58 58
59 if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 &&59 if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 &&
60 avctx->pix_fmt == PIX_FMT_YUYV422) {60 avctx->pix_fmt == AV_PIX_FMT_YUYV422) {
61 int x;61 int x;
62 for(x = 1; x < avctx->height*avctx->width*2; x += 2)62 for(x = 1; x < avctx->height*avctx->width*2; x += 2)
63 pkt->data[x] ^= 0x80;63 pkt->data[x] ^= 0x80;
libavcodec/rl2.c+1−1
@@ -134,7 +134,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) · 133 unmodified lines
134 int back_size;134 int back_size;
135 int i;135 int i;
136 s->avctx = avctx;136 s->avctx = avctx;
137 avctx->pix_fmt = PIX_FMT_PAL8;137 avctx->pix_fmt = AV_PIX_FMT_PAL8;
138 138
139 /** parse extra data */139 /** parse extra data */
140 if(!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE){140 if(!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE){
libavcodec/roqvideodec.c+1−1
@@ -163,7 +163,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) · 162 unmodified lines
163 s->height = avctx->height;163 s->height = avctx->height;
164 s->last_frame = &s->frames[0];164 s->last_frame = &s->frames[0];
165 s->current_frame = &s->frames[1];165 s->current_frame = &s->frames[1];
166 avctx->pix_fmt = PIX_FMT_YUV444P;166 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
167 167
168 return 0;168 return 0;
169}169}
libavcodec/roqvideoenc.c+2−2
@@ -1081,7 +1081,7 @@ AVCodec ff_roq_encoder = { · 1080 unmodified lines
1081 .encode2 = roq_encode_frame,1081 .encode2 = roq_encode_frame,
1082 .close = roq_encode_end,1082 .close = roq_encode_end,
1083 .supported_framerates = (const AVRational[]){ {30,1}, {0,0} },1083 .supported_framerates = (const AVRational[]){ {30,1}, {0,0} },
1084 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV444P,1084 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P,
1085 PIX_FMT_NONE },1085 AV_PIX_FMT_NONE },
1086 .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"),1086 .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"),
1087};1087};
libavcodec/rpza.c+1−1
@@ -236,7 +236,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) · 235 unmodified lines
236 RpzaContext *s = avctx->priv_data;236 RpzaContext *s = avctx->priv_data;
237 237
238 s->avctx = avctx;238 s->avctx = avctx;
239 avctx->pix_fmt = PIX_FMT_RGB555;239 avctx->pix_fmt = AV_PIX_FMT_RGB555;
240 240
241 s->frame.data[0] = NULL;241 s->frame.data[0] = NULL;
242 242
libavcodec/rv10.c+1−1
@@ -467,7 +467,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) · 466 unmodified lines
467 av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);467 av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1);
468 }468 }
469 469
470 avctx->pix_fmt = PIX_FMT_YUV420P;470 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
471 471
472 if (ff_MPV_common_init(s) < 0)472 if (ff_MPV_common_init(s) < 0)
473 return -1;473 return -1;
libavcodec/rv10enc.c+1−1
@@ -66,7 +66,7 @@ AVCodec ff_rv10_encoder = { · 65 unmodified lines
66 .init = ff_MPV_encode_init,66 .init = ff_MPV_encode_init,
67 .encode2 = ff_MPV_encode_picture,67 .encode2 = ff_MPV_encode_picture,
68 .close = ff_MPV_encode_end,68 .close = ff_MPV_encode_end,
69 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },69 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
70 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),70 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"),
71 .priv_class = &rv10_class,71 .priv_class = &rv10_class,
72};72};
libavcodec/rv20enc.c+1−1
@@ -67,7 +67,7 @@ AVCodec ff_rv20_encoder = { · 66 unmodified lines
67 .init = ff_MPV_encode_init,67 .init = ff_MPV_encode_init,
68 .encode2 = ff_MPV_encode_picture,68 .encode2 = ff_MPV_encode_picture,
69 .close = ff_MPV_encode_end,69 .close = ff_MPV_encode_end,
70 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },70 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
71 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"),71 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"),
72 .priv_class = &rv20_class,72 .priv_class = &rv20_class,
73};73};
libavcodec/rv34.c+1−1
@@ -1479,7 +1479,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) · 1478 unmodified lines
1479 r->s.avctx = avctx;1479 r->s.avctx = avctx;
1480 avctx->flags |= CODEC_FLAG_EMU_EDGE;1480 avctx->flags |= CODEC_FLAG_EMU_EDGE;
1481 r->s.flags |= CODEC_FLAG_EMU_EDGE;1481 r->s.flags |= CODEC_FLAG_EMU_EDGE;
1482 avctx->pix_fmt = PIX_FMT_YUV420P;1482 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
1483 avctx->has_b_frames = 1;1483 avctx->has_b_frames = 1;
1484 s->low_delay = 0;1484 s->low_delay = 0;
1485 1485
libavcodec/sgidec.c+3−3
@@ -191,11 +191,11 @@ static int decode_frame(AVCodecContext *avctx, · 190 unmodified lines
191 }191 }
192 192
193 if (s->depth == SGI_GRAYSCALE) {193 if (s->depth == SGI_GRAYSCALE) {
194 avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_GRAY16BE : PIX_FMT_GRAY8;194 avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8;
195 } else if (s->depth == SGI_RGB) {195 } else if (s->depth == SGI_RGB) {
196 avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_RGB48BE : PIX_FMT_RGB24;196 avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB24;
197 } else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) {197 } else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) {
198 avctx->pix_fmt = PIX_FMT_RGBA;198 avctx->pix_fmt = AV_PIX_FMT_RGBA;
199 } else {199 } else {
200 av_log(avctx, AV_LOG_ERROR, "wrong picture format\n");200 av_log(avctx, AV_LOG_ERROR, "wrong picture format\n");
201 return -1;201 return -1;
libavcodec/sgienc.c+5−5
@@ -60,15 +60,15 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 59 unmodified lines
60 height = avctx->height;60 height = avctx->height;
61 61
62 switch (avctx->pix_fmt) {62 switch (avctx->pix_fmt) {
63 case PIX_FMT_GRAY8:63 case AV_PIX_FMT_GRAY8:
64 dimension = SGI_SINGLE_CHAN;64 dimension = SGI_SINGLE_CHAN;
65 depth = SGI_GRAYSCALE;65 depth = SGI_GRAYSCALE;
66 break;66 break;
67 case PIX_FMT_RGB24:67 case AV_PIX_FMT_RGB24:
68 dimension = SGI_MULTI_CHAN;68 dimension = SGI_MULTI_CHAN;
69 depth = SGI_RGB;69 depth = SGI_RGB;
70 break;70 break;
71 case PIX_FMT_RGBA:71 case AV_PIX_FMT_RGBA:
72 dimension = SGI_MULTI_CHAN;72 dimension = SGI_MULTI_CHAN;
73 depth = SGI_RGBA;73 depth = SGI_RGBA;
74 break;74 break;
@@ -177,8 +177,8 @@ AVCodec ff_sgi_encoder = { · 102 unmodified lines
177 .priv_data_size = sizeof(SgiContext),177 .priv_data_size = sizeof(SgiContext),
178 .init = encode_init,178 .init = encode_init,
179 .encode2 = encode_frame,179 .encode2 = encode_frame,
180 .pix_fmts = (const enum PixelFormat[]){180 .pix_fmts = (const enum AVPixelFormat[]){
181 PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_GRAY8, PIX_FMT_NONE181 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
182 },182 },
183 .long_name = NULL_IF_CONFIG_SMALL("SGI image"),183 .long_name = NULL_IF_CONFIG_SMALL("SGI image"),
184};184};
libavcodec/smacker.c+1−1
@@ -515,7 +515,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 514 unmodified lines
515 515
516 c->avctx = avctx;516 c->avctx = avctx;
517 517
518 avctx->pix_fmt = PIX_FMT_PAL8;518 avctx->pix_fmt = AV_PIX_FMT_PAL8;
519 519
520 520
521 /* decode huffman trees from extradata */521 /* decode huffman trees from extradata */
libavcodec/smc.c+1−1
@@ -414,7 +414,7 @@ static av_cold int smc_decode_init(AVCodecContext *avctx) · 413 unmodified lines
414 SmcContext *s = avctx->priv_data;414 SmcContext *s = avctx->priv_data;
415 415
416 s->avctx = avctx;416 s->avctx = avctx;
417 avctx->pix_fmt = PIX_FMT_PAL8;417 avctx->pix_fmt = AV_PIX_FMT_PAL8;
418 418
419 s->frame.data[0] = NULL;419 s->frame.data[0] = NULL;
420 420
libavcodec/snowdec.c+1−1
@@ -356,7 +356,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 355 unmodified lines
356{356{
357 int ret;357 int ret;
358 358
359 avctx->pix_fmt= PIX_FMT_YUV420P;359 avctx->pix_fmt= AV_PIX_FMT_YUV420P;
360 360
361 if ((ret = ff_snow_common_init(avctx)) < 0) {361 if ((ret = ff_snow_common_init(avctx)) < 0) {
362 ff_snow_common_end(avctx->priv_data);362 ff_snow_common_end(avctx->priv_data);
libavcodec/snowenc.c+7−7
@@ -217,15 +217,15 @@ static av_cold int encode_init(AVCodecContext *avctx) · 216 unmodified lines
217 217
218 avctx->coded_frame= &s->current_picture;218 avctx->coded_frame= &s->current_picture;
219 switch(avctx->pix_fmt){219 switch(avctx->pix_fmt){
220// case PIX_FMT_YUV444P:220// case AV_PIX_FMT_YUV444P:
221// case PIX_FMT_YUV422P:221// case AV_PIX_FMT_YUV422P:
222 case PIX_FMT_YUV420P:222 case AV_PIX_FMT_YUV420P:
223 case PIX_FMT_GRAY8:223 case AV_PIX_FMT_GRAY8:
224// case PIX_FMT_YUV411P:224// case AV_PIX_FMT_YUV411P:
225// case PIX_FMT_YUV410P:225// case AV_PIX_FMT_YUV410P:
226 s->colorspace_type= 0;226 s->colorspace_type= 0;
227 break;227 break;
228/* case PIX_FMT_RGB32:228/* case AV_PIX_FMT_RGB32:
229 s->colorspace= 1;229 s->colorspace= 1;
230 break;*/230 break;*/
231 default:231 default:
libavcodec/sunrast.c+3−3
@@ -90,13 +90,13 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, · 89 unmodified lines
90 90
91 switch (depth) {91 switch (depth) {
92 case 1:92 case 1:
93 avctx->pix_fmt = PIX_FMT_MONOWHITE;93 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
94 break;94 break;
95 case 8:95 case 8:
96 avctx->pix_fmt = maplength ? PIX_FMT_PAL8 : PIX_FMT_GRAY8;96 avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_GRAY8;
97 break;97 break;
98 case 24:98 case 24:
99 avctx->pix_fmt = (type == RT_FORMAT_RGB) ? PIX_FMT_RGB24 : PIX_FMT_BGR24;99 avctx->pix_fmt = (type == RT_FORMAT_RGB) ? AV_PIX_FMT_RGB24 : AV_PIX_FMT_BGR24;
100 break;100 break;
101 default:101 default:
102 av_log(avctx, AV_LOG_ERROR, "invalid depth\n");102 av_log(avctx, AV_LOG_ERROR, "invalid depth\n");
libavcodec/sunrastenc.c+9−9
@@ -161,16 +161,16 @@ static av_cold int sunrast_encode_init(AVCodecContext *avctx) · 160 unmodified lines
161 s->maplength = 0;161 s->maplength = 0;
162 162
163 switch (avctx->pix_fmt) {163 switch (avctx->pix_fmt) {
164 case PIX_FMT_MONOWHITE:164 case AV_PIX_FMT_MONOWHITE:
165 s->depth = 1;165 s->depth = 1;
166 break;166 break;
167 case PIX_FMT_PAL8 :167 case AV_PIX_FMT_PAL8 :
168 s->maptype = RMT_EQUAL_RGB;168 s->maptype = RMT_EQUAL_RGB;
169 s->maplength = 3 * 256;169 s->maplength = 3 * 256;
170 case PIX_FMT_GRAY8:170 case AV_PIX_FMT_GRAY8:
171 s->depth = 8;171 s->depth = 8;
172 break;172 break;
173 case PIX_FMT_BGR24:173 case AV_PIX_FMT_BGR24:
174 s->depth = 24;174 s->depth = 24;
175 break;175 break;
176 default:176 default:
@@ -220,10 +220,10 @@ AVCodec ff_sunrast_encoder = { · 43 unmodified lines
220 .init = sunrast_encode_init,220 .init = sunrast_encode_init,
221 .encode2 = sunrast_encode_frame,221 .encode2 = sunrast_encode_frame,
222 .defaults = sunrast_defaults,222 .defaults = sunrast_defaults,
223 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24,223 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24,
224 PIX_FMT_PAL8,224 AV_PIX_FMT_PAL8,
225 PIX_FMT_GRAY8,225 AV_PIX_FMT_GRAY8,
226 PIX_FMT_MONOWHITE,226 AV_PIX_FMT_MONOWHITE,
227 PIX_FMT_NONE },227 AV_PIX_FMT_NONE },
228 .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),228 .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"),
229};229};
libavcodec/svq1dec.c+2−2
@@ -714,7 +714,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) · 713 unmodified lines
714 s->width = (avctx->width+3)&~3;714 s->width = (avctx->width+3)&~3;
715 s->height = (avctx->height+3)&~3;715 s->height = (avctx->height+3)&~3;
716 s->codec_id= avctx->codec->id;716 s->codec_id= avctx->codec->id;
717 avctx->pix_fmt = PIX_FMT_YUV410P;717 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
718 avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames718 avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames
719 s->flags= avctx->flags;719 s->flags= avctx->flags;
720 if (ff_MPV_common_init(s) < 0) return -1;720 if (ff_MPV_common_init(s) < 0) return -1;
@@ -774,6 +774,6 @@ AVCodec ff_svq1_decoder = { · 53 unmodified lines
774 .decode = svq1_decode_frame,774 .decode = svq1_decode_frame,
775 .capabilities = CODEC_CAP_DR1,775 .capabilities = CODEC_CAP_DR1,
776 .flush = ff_mpeg_flush,776 .flush = ff_mpeg_flush,
777 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV410P, PIX_FMT_NONE },777 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE },
778 .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),778 .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
779};779};
libavcodec/svq1enc.c+2−2
@@ -512,7 +512,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 511 unmodified lines
512 return ret;512 return ret;
513 }513 }
514 514
515 if(avctx->pix_fmt != PIX_FMT_YUV410P){515 if(avctx->pix_fmt != AV_PIX_FMT_YUV410P){
516 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");516 av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
517 return -1;517 return -1;
518 }518 }
@@ -587,6 +587,6 @@ AVCodec ff_svq1_encoder = { · 68 unmodified lines
587 .init = svq1_encode_init,587 .init = svq1_encode_init,
588 .encode2 = svq1_encode_frame,588 .encode2 = svq1_encode_frame,
589 .close = svq1_encode_end,589 .close = svq1_encode_end,
590 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV410P, PIX_FMT_NONE },590 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE },
591 .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),591 .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
592};592};
libavcodec/svq3.c+1−1
@@ -1112,5 +1112,5 @@ AVCodec ff_svq3_decoder = { · 1111 unmodified lines
1112 .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |1112 .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
1113 CODEC_CAP_DELAY,1113 CODEC_CAP_DELAY,
1114 .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),1114 .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"),
1115 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUVJ420P, PIX_FMT_NONE },1115 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE },
1116};1116};
libavcodec/targa.c+6−6
@@ -124,19 +124,19 @@ static int decode_frame(AVCodecContext *avctx, · 123 unmodified lines
124 124
125 switch(bpp){125 switch(bpp){
126 case 8:126 case 8:
127 avctx->pix_fmt = ((compr & (~TGA_RLE)) == TGA_BW) ? PIX_FMT_GRAY8 : PIX_FMT_PAL8;127 avctx->pix_fmt = ((compr & (~TGA_RLE)) == TGA_BW) ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_PAL8;
128 break;128 break;
129 case 15:129 case 15:
130 avctx->pix_fmt = PIX_FMT_RGB555LE;130 avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
131 break;131 break;
132 case 16:132 case 16:
133 avctx->pix_fmt = PIX_FMT_RGB555LE;133 avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
134 break;134 break;
135 case 24:135 case 24:
136 avctx->pix_fmt = PIX_FMT_BGR24;136 avctx->pix_fmt = AV_PIX_FMT_BGR24;
137 break;137 break;
138 case 32:138 case 32:
139 avctx->pix_fmt = PIX_FMT_BGRA;139 avctx->pix_fmt = AV_PIX_FMT_BGRA;
140 break;140 break;
141 default:141 default:
142 av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", bpp);142 av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", bpp);
@@ -177,7 +177,7 @@ static int decode_frame(AVCodecContext *avctx, · 34 unmodified lines
177 return -1;177 return -1;
178 }178 }
179 pal_size = colors * pal_sample_size;179 pal_size = colors * pal_sample_size;
180 if(avctx->pix_fmt != PIX_FMT_PAL8)//should not occur but skip palette anyway180 if(avctx->pix_fmt != AV_PIX_FMT_PAL8)//should not occur but skip palette anyway
181 bytestream2_skip(&s->gb, pal_size);181 bytestream2_skip(&s->gb, pal_size);
182 else{182 else{
183 int t;183 int t;
libavcodec/targaenc.c+8−8
@@ -99,22 +99,22 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 98 unmodified lines
99 AV_WL16(pkt->data+12, avctx->width);99 AV_WL16(pkt->data+12, avctx->width);
100 AV_WL16(pkt->data+14, avctx->height);100 AV_WL16(pkt->data+14, avctx->height);
101 /* image descriptor byte: origin is always top-left, bits 0-3 specify alpha */101 /* image descriptor byte: origin is always top-left, bits 0-3 specify alpha */
102 pkt->data[17] = 0x20 | (avctx->pix_fmt == PIX_FMT_BGRA ? 8 : 0);102 pkt->data[17] = 0x20 | (avctx->pix_fmt == AV_PIX_FMT_BGRA ? 8 : 0);
103 103
104 switch(avctx->pix_fmt) {104 switch(avctx->pix_fmt) {
105 case PIX_FMT_GRAY8:105 case AV_PIX_FMT_GRAY8:
106 pkt->data[2] = TGA_BW; /* uncompressed grayscale image */106 pkt->data[2] = TGA_BW; /* uncompressed grayscale image */
107 pkt->data[16] = 8; /* bpp */107 pkt->data[16] = 8; /* bpp */
108 break;108 break;
109 case PIX_FMT_RGB555LE:109 case AV_PIX_FMT_RGB555LE:
110 pkt->data[2] = TGA_RGB; /* uncompresses true-color image */110 pkt->data[2] = TGA_RGB; /* uncompresses true-color image */
111 pkt->data[16] = 16; /* bpp */111 pkt->data[16] = 16; /* bpp */
112 break;112 break;
113 case PIX_FMT_BGR24:113 case AV_PIX_FMT_BGR24:
114 pkt->data[2] = TGA_RGB; /* uncompressed true-color image */114 pkt->data[2] = TGA_RGB; /* uncompressed true-color image */
115 pkt->data[16] = 24; /* bpp */115 pkt->data[16] = 24; /* bpp */
116 break;116 break;
117 case PIX_FMT_BGRA:117 case AV_PIX_FMT_BGRA:
118 pkt->data[2] = TGA_RGB; /* uncompressed true-color image */118 pkt->data[2] = TGA_RGB; /* uncompressed true-color image */
119 pkt->data[16] = 32; /* bpp */119 pkt->data[16] = 32; /* bpp */
120 break;120 break;
@@ -171,9 +171,9 @@ AVCodec ff_targa_encoder = { · 50 unmodified lines
171 .priv_data_size = sizeof(TargaContext),171 .priv_data_size = sizeof(TargaContext),
172 .init = targa_encode_init,172 .init = targa_encode_init,
173 .encode2 = targa_encode_frame,173 .encode2 = targa_encode_frame,
174 .pix_fmts = (const enum PixelFormat[]){174 .pix_fmts = (const enum AVPixelFormat[]){
175 PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_RGB555LE, PIX_FMT_GRAY8,175 AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8,
176 PIX_FMT_NONE176 AV_PIX_FMT_NONE
177 },177 },
178 .long_name= NULL_IF_CONFIG_SMALL("Truevision Targa image"),178 .long_name= NULL_IF_CONFIG_SMALL("Truevision Targa image"),
179};179};
libavcodec/tiertexseqv.c+1−1
@@ -214,7 +214,7 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx) · 213 unmodified lines
214 SeqVideoContext *seq = avctx->priv_data;214 SeqVideoContext *seq = avctx->priv_data;
215 215
216 seq->avctx = avctx;216 seq->avctx = avctx;
217 avctx->pix_fmt = PIX_FMT_PAL8;217 avctx->pix_fmt = AV_PIX_FMT_PAL8;
218 218
219 seq->frame.data[0] = NULL;219 seq->frame.data[0] = NULL;
220 220
libavcodec/tiff.c+7−7
@@ -250,22 +250,22 @@ static int init_image(TiffContext *s) · 249 unmodified lines
250 250
251 switch (s->bpp * 10 + s->bppcount) {251 switch (s->bpp * 10 + s->bppcount) {
252 case 11:252 case 11:
253 s->avctx->pix_fmt = PIX_FMT_MONOBLACK;253 s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
254 break;254 break;
255 case 81:255 case 81:
256 s->avctx->pix_fmt = PIX_FMT_PAL8;256 s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
257 break;257 break;
258 case 243:258 case 243:
259 s->avctx->pix_fmt = PIX_FMT_RGB24;259 s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
260 break;260 break;
261 case 161:261 case 161:
262 s->avctx->pix_fmt = s->le ? PIX_FMT_GRAY16LE : PIX_FMT_GRAY16BE;262 s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GRAY16LE : AV_PIX_FMT_GRAY16BE;
263 break;263 break;
264 case 324:264 case 324:
265 s->avctx->pix_fmt = PIX_FMT_RGBA;265 s->avctx->pix_fmt = AV_PIX_FMT_RGBA;
266 break;266 break;
267 case 483:267 case 483:
268 s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE;268 s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGB48LE : AV_PIX_FMT_RGB48BE;
269 break;269 break;
270 default:270 default:
271 av_log(s->avctx, AV_LOG_ERROR,271 av_log(s->avctx, AV_LOG_ERROR,
@@ -284,7 +284,7 @@ static int init_image(TiffContext *s) · 12 unmodified lines
284 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");284 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
285 return ret;285 return ret;
286 }286 }
287 if (s->avctx->pix_fmt == PIX_FMT_PAL8) {287 if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
288 if (s->palette_is_set) {288 if (s->palette_is_set) {
289 memcpy(s->picture.data[1], s->palette, sizeof(s->palette));289 memcpy(s->picture.data[1], s->palette, sizeof(s->palette));
290 } else {290 } else {
libavcodec/tiffenc.c+20−20
@@ -235,11 +235,11 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt, · 234 unmodified lines
235 s->subsampling[1] = 1;235 s->subsampling[1] = 1;
236 236
237 switch (avctx->pix_fmt) {237 switch (avctx->pix_fmt) {
238 case PIX_FMT_RGB48LE:238 case AV_PIX_FMT_RGB48LE:
239 case PIX_FMT_GRAY16LE:239 case AV_PIX_FMT_GRAY16LE:
240 case PIX_FMT_RGB24:240 case AV_PIX_FMT_RGB24:
241 case PIX_FMT_GRAY8:241 case AV_PIX_FMT_GRAY8:
242 case PIX_FMT_PAL8:242 case AV_PIX_FMT_PAL8:
243 pfd = &av_pix_fmt_descriptors[avctx->pix_fmt];243 pfd = &av_pix_fmt_descriptors[avctx->pix_fmt];
244 s->bpp = av_get_bits_per_pixel(pfd);244 s->bpp = av_get_bits_per_pixel(pfd);
245 if (pfd->flags & PIX_FMT_PAL) {245 if (pfd->flags & PIX_FMT_PAL) {
@@ -254,21 +254,21 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt, · 8 unmodified lines
254 bpp_tab[i] = s->bpp / s->bpp_tab_size;254 bpp_tab[i] = s->bpp / s->bpp_tab_size;
255 }255 }
256 break;256 break;
257 case PIX_FMT_MONOBLACK:257 case AV_PIX_FMT_MONOBLACK:
258 s->bpp = 1;258 s->bpp = 1;
259 s->photometric_interpretation = 1;259 s->photometric_interpretation = 1;
260 s->bpp_tab_size = 0;260 s->bpp_tab_size = 0;
261 break;261 break;
262 case PIX_FMT_MONOWHITE:262 case AV_PIX_FMT_MONOWHITE:
263 s->bpp = 1;263 s->bpp = 1;
264 s->photometric_interpretation = 0;264 s->photometric_interpretation = 0;
265 s->bpp_tab_size = 0;265 s->bpp_tab_size = 0;
266 break;266 break;
267 case PIX_FMT_YUV420P:267 case AV_PIX_FMT_YUV420P:
268 case PIX_FMT_YUV422P:268 case AV_PIX_FMT_YUV422P:
269 case PIX_FMT_YUV444P:269 case AV_PIX_FMT_YUV444P:
270 case PIX_FMT_YUV410P:270 case AV_PIX_FMT_YUV410P:
271 case PIX_FMT_YUV411P:271 case AV_PIX_FMT_YUV411P:
272 s->photometric_interpretation = 6;272 s->photometric_interpretation = 6;
273 avcodec_get_chroma_sub_sample(avctx->pix_fmt,273 avcodec_get_chroma_sub_sample(avctx->pix_fmt,
274 &shift_h, &shift_v);274 &shift_h, &shift_v);
@@ -433,7 +433,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt, · 158 unmodified lines
433 add_entry(s, TIFF_SOFTWARE_NAME, TIFF_STRING,433 add_entry(s, TIFF_SOFTWARE_NAME, TIFF_STRING,
434 strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT);434 strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT);
435 435
436 if (avctx->pix_fmt == PIX_FMT_PAL8) {436 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
437 uint16_t pal[256 * 3];437 uint16_t pal[256 * 3];
438 for (i = 0; i < 256; i++) {438 for (i = 0; i < 256; i++) {
439 uint32_t rgb = *(uint32_t *) (p->data[1] + i * 4);439 uint32_t rgb = *(uint32_t *) (p->data[1] + i * 4);
@@ -496,13 +496,13 @@ AVCodec ff_tiff_encoder = { · 56 unmodified lines
496 .id = AV_CODEC_ID_TIFF,496 .id = AV_CODEC_ID_TIFF,
497 .priv_data_size = sizeof(TiffEncoderContext),497 .priv_data_size = sizeof(TiffEncoderContext),
498 .encode2 = encode_frame,498 .encode2 = encode_frame,
499 .pix_fmts = (const enum PixelFormat[]) {499 .pix_fmts = (const enum AVPixelFormat[]) {
500 PIX_FMT_RGB24, PIX_FMT_RGB48LE, PIX_FMT_PAL8,500 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8,
501 PIX_FMT_GRAY8, PIX_FMT_GRAY16LE,501 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16LE,
502 PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE,502 AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOWHITE,
503 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P,503 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
504 PIX_FMT_YUV410P, PIX_FMT_YUV411P,504 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
505 PIX_FMT_NONE505 AV_PIX_FMT_NONE
506 },506 },
507 .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),507 .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
508 .priv_class = &tiffenc_class,508 .priv_class = &tiffenc_class,
libavcodec/tmv.c+1−1
@@ -87,7 +87,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, · 86 unmodified lines
87 87
88static av_cold int tmv_decode_init(AVCodecContext *avctx)88static av_cold int tmv_decode_init(AVCodecContext *avctx)
89{89{
90 avctx->pix_fmt = PIX_FMT_PAL8;90 avctx->pix_fmt = AV_PIX_FMT_PAL8;
91 return 0;91 return 0;
92}92}
93 93
libavcodec/truemotion1.c+5−5
@@ -390,10 +390,10 @@ static int truemotion1_decode_header(TrueMotion1Context *s) · 389 unmodified lines
390 }390 }
391 391
392 if (compression_types[header.compression].algorithm == ALGO_RGB24H) {392 if (compression_types[header.compression].algorithm == ALGO_RGB24H) {
393 new_pix_fmt = PIX_FMT_RGB32;393 new_pix_fmt = AV_PIX_FMT_RGB32;
394 width_shift = 1;394 width_shift = 1;
395 } else395 } else
396 new_pix_fmt = PIX_FMT_RGB555; // RGB565 is supported as well396 new_pix_fmt = AV_PIX_FMT_RGB555; // RGB565 is supported as well
397 397
398 s->w >>= width_shift;398 s->w >>= width_shift;
399 if (av_image_check_size(s->w, s->h, 0, s->avctx) < 0)399 if (av_image_check_size(s->w, s->h, 0, s->avctx) < 0)
@@ -419,7 +419,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s) · 19 unmodified lines
419 if (compression_types[header.compression].algorithm == ALGO_RGB24H)419 if (compression_types[header.compression].algorithm == ALGO_RGB24H)
420 gen_vector_table24(s, sel_vector_table);420 gen_vector_table24(s, sel_vector_table);
421 else421 else
422 if (s->avctx->pix_fmt == PIX_FMT_RGB555)422 if (s->avctx->pix_fmt == AV_PIX_FMT_RGB555)
423 gen_vector_table15(s, sel_vector_table);423 gen_vector_table15(s, sel_vector_table);
424 else424 else
425 gen_vector_table16(s, sel_vector_table);425 gen_vector_table16(s, sel_vector_table);
@@ -464,9 +464,9 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx) · 38 unmodified lines
464 464
465 // FIXME: it may change ?465 // FIXME: it may change ?
466// if (avctx->bits_per_sample == 24)466// if (avctx->bits_per_sample == 24)
467// avctx->pix_fmt = PIX_FMT_RGB24;467// avctx->pix_fmt = AV_PIX_FMT_RGB24;
468// else468// else
469// avctx->pix_fmt = PIX_FMT_RGB555;469// avctx->pix_fmt = AV_PIX_FMT_RGB555;
470 470
471 s->frame.data[0] = NULL;471 s->frame.data[0] = NULL;
472 472
libavcodec/truemotion2.c+1−1
@@ -879,7 +879,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ · 878 unmodified lines
879 879
880 l->avctx = avctx;880 l->avctx = avctx;
881 l->pic.data[0]=NULL;881 l->pic.data[0]=NULL;
882 avctx->pix_fmt = PIX_FMT_BGR24;882 avctx->pix_fmt = AV_PIX_FMT_BGR24;
883 883
884 ff_dsputil_init(&l->dsp, avctx);884 ff_dsputil_init(&l->dsp, avctx);
885 885
libavcodec/tscc.c+5−5
@@ -113,7 +113,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 112 unmodified lines
113 }113 }
114 114
115 /* make the palette available on the way out */115 /* make the palette available on the way out */
116 if (c->avctx->pix_fmt == PIX_FMT_PAL8) {116 if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
117 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);117 const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
118 118
119 if (pal) {119 if (pal) {
@@ -149,12 +149,12 @@ static av_cold int decode_init(AVCodecContext *avctx) · 29 unmodified lines
149 // Needed if zlib unused or init aborted before inflateInit149 // Needed if zlib unused or init aborted before inflateInit
150 memset(&c->zstream, 0, sizeof(z_stream));150 memset(&c->zstream, 0, sizeof(z_stream));
151 switch(avctx->bits_per_coded_sample){151 switch(avctx->bits_per_coded_sample){
152 case 8: avctx->pix_fmt = PIX_FMT_PAL8; break;152 case 8: avctx->pix_fmt = AV_PIX_FMT_PAL8; break;
153 case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;153 case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
154 case 24:154 case 24:
155 avctx->pix_fmt = PIX_FMT_BGR24;155 avctx->pix_fmt = AV_PIX_FMT_BGR24;
156 break;156 break;
157 case 32: avctx->pix_fmt = PIX_FMT_RGB32; break;157 case 32: avctx->pix_fmt = AV_PIX_FMT_RGB32; break;
158 default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_coded_sample);158 default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_coded_sample);
159 return -1;159 return -1;
160 }160 }
libavcodec/tscc2.c+1−1
@@ -336,7 +336,7 @@ static av_cold int tscc2_decode_init(AVCodecContext *avctx) · 335 unmodified lines
336 336
337 c->avctx = avctx;337 c->avctx = avctx;
338 338
339 avctx->pix_fmt = PIX_FMT_YUV444P;339 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
340 340
341 if ((ret = init_vlcs(c)) < 0) {341 if ((ret = init_vlcs(c)) < 0) {
342 av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");342 av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");
libavcodec/txd.c+2−2
@@ -68,9 +68,9 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 67 unmodified lines
68 }68 }
69 69
70 if (depth == 8) {70 if (depth == 8) {
71 avctx->pix_fmt = PIX_FMT_PAL8;71 avctx->pix_fmt = AV_PIX_FMT_PAL8;
72 } else if (depth == 16 || depth == 32) {72 } else if (depth == 16 || depth == 32) {
73 avctx->pix_fmt = PIX_FMT_RGB32;73 avctx->pix_fmt = AV_PIX_FMT_RGB32;
74 } else {74 } else {
75 av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth);75 av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth);
76 return -1;76 return -1;
libavcodec/ulti.c+1−1
@@ -49,7 +49,7 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx) · 48 unmodified lines
49 s->width = avctx->width;49 s->width = avctx->width;
50 s->height = avctx->height;50 s->height = avctx->height;
51 s->blocks = (s->width / 8) * (s->height / 8);51 s->blocks = (s->width / 8) * (s->height / 8);
52 avctx->pix_fmt = PIX_FMT_YUV410P;52 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
53 avctx->coded_frame = &s->frame;53 avctx->coded_frame = &s->frame;
54 s->ulti_codebook = ulti_codebook;54 s->ulti_codebook = ulti_codebook;
55 55
libavcodec/utils.c+45−45
@@ -165,64 +165,64 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, · 164 unmodified lines
165 int h_align = 1;165 int h_align = 1;
166 166
167 switch (s->pix_fmt) {167 switch (s->pix_fmt) {
168 case PIX_FMT_YUV420P:168 case AV_PIX_FMT_YUV420P:
169 case PIX_FMT_YUYV422:169 case AV_PIX_FMT_YUYV422:
170 case PIX_FMT_UYVY422:170 case AV_PIX_FMT_UYVY422:
171 case PIX_FMT_YUV422P:171 case AV_PIX_FMT_YUV422P:
172 case PIX_FMT_YUV440P:172 case AV_PIX_FMT_YUV440P:
173 case PIX_FMT_YUV444P:173 case AV_PIX_FMT_YUV444P:
174 case PIX_FMT_GBRP:174 case AV_PIX_FMT_GBRP:
175 case PIX_FMT_GRAY8:175 case AV_PIX_FMT_GRAY8:
176 case PIX_FMT_GRAY16BE:176 case AV_PIX_FMT_GRAY16BE:
177 case PIX_FMT_GRAY16LE:177 case AV_PIX_FMT_GRAY16LE:
178 case PIX_FMT_YUVJ420P:178 case AV_PIX_FMT_YUVJ420P:
179 case PIX_FMT_YUVJ422P:179 case AV_PIX_FMT_YUVJ422P:
180 case PIX_FMT_YUVJ440P:180 case AV_PIX_FMT_YUVJ440P:
181 case PIX_FMT_YUVJ444P:181 case AV_PIX_FMT_YUVJ444P:
182 case PIX_FMT_YUVA420P:182 case AV_PIX_FMT_YUVA420P:
183 case PIX_FMT_YUV420P9LE:183 case AV_PIX_FMT_YUV420P9LE:
184 case PIX_FMT_YUV420P9BE:184 case AV_PIX_FMT_YUV420P9BE:
185 case PIX_FMT_YUV420P10LE:185 case AV_PIX_FMT_YUV420P10LE:
186 case PIX_FMT_YUV420P10BE:186 case AV_PIX_FMT_YUV420P10BE:
187 case PIX_FMT_YUV422P9LE:187 case AV_PIX_FMT_YUV422P9LE:
188 case PIX_FMT_YUV422P9BE:188 case AV_PIX_FMT_YUV422P9BE:
189 case PIX_FMT_YUV422P10LE:189 case AV_PIX_FMT_YUV422P10LE:
190 case PIX_FMT_YUV422P10BE:190 case AV_PIX_FMT_YUV422P10BE:
191 case PIX_FMT_YUV444P9LE:191 case AV_PIX_FMT_YUV444P9LE:
192 case PIX_FMT_YUV444P9BE:192 case AV_PIX_FMT_YUV444P9BE:
193 case PIX_FMT_YUV444P10LE:193 case AV_PIX_FMT_YUV444P10LE:
194 case PIX_FMT_YUV444P10BE:194 case AV_PIX_FMT_YUV444P10BE:
195 case PIX_FMT_GBRP9LE:195 case AV_PIX_FMT_GBRP9LE:
196 case PIX_FMT_GBRP9BE:196 case AV_PIX_FMT_GBRP9BE:
197 case PIX_FMT_GBRP10LE:197 case AV_PIX_FMT_GBRP10LE:
198 case PIX_FMT_GBRP10BE:198 case AV_PIX_FMT_GBRP10BE:
199 w_align = 16; //FIXME assume 16 pixel per macroblock199 w_align = 16; //FIXME assume 16 pixel per macroblock
200 h_align = 16 * 2; // interlaced needs 2 macroblocks height200 h_align = 16 * 2; // interlaced needs 2 macroblocks height
201 break;201 break;
202 case PIX_FMT_YUV411P:202 case AV_PIX_FMT_YUV411P:
203 case PIX_FMT_UYYVYY411:203 case AV_PIX_FMT_UYYVYY411:
204 w_align = 32;204 w_align = 32;
205 h_align = 8;205 h_align = 8;
206 break;206 break;
207 case PIX_FMT_YUV410P:207 case AV_PIX_FMT_YUV410P:
208 if (s->codec_id == AV_CODEC_ID_SVQ1) {208 if (s->codec_id == AV_CODEC_ID_SVQ1) {
209 w_align = 64;209 w_align = 64;
210 h_align = 64;210 h_align = 64;
211 }211 }
212 case PIX_FMT_RGB555:212 case AV_PIX_FMT_RGB555:
213 if (s->codec_id == AV_CODEC_ID_RPZA) {213 if (s->codec_id == AV_CODEC_ID_RPZA) {
214 w_align = 4;214 w_align = 4;
215 h_align = 4;215 h_align = 4;
216 }216 }
217 case PIX_FMT_PAL8:217 case AV_PIX_FMT_PAL8:
218 case PIX_FMT_BGR8:218 case AV_PIX_FMT_BGR8:
219 case PIX_FMT_RGB8:219 case AV_PIX_FMT_RGB8:
220 if (s->codec_id == AV_CODEC_ID_SMC) {220 if (s->codec_id == AV_CODEC_ID_SMC) {
221 w_align = 4;221 w_align = 4;
222 h_align = 4;222 h_align = 4;
223 }223 }
224 break;224 break;
225 case PIX_FMT_BGR24:225 case AV_PIX_FMT_BGR24:
226 if ((s->codec_id == AV_CODEC_ID_MSZH) ||226 if ((s->codec_id == AV_CODEC_ID_MSZH) ||
227 (s->codec_id == AV_CODEC_ID_ZLIB)) {227 (s->codec_id == AV_CODEC_ID_ZLIB)) {
228 w_align = 4;228 w_align = 4;
@@ -624,9 +624,9 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, · 395 unmodified lines
624 return 0;624 return 0;
625}625}
626 626
627enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt)627enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt)
628{628{
629 while (*fmt != PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt))629 while (*fmt != AV_PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt))
630 ++fmt;630 ++fmt;
631 return fmt[0];631 return fmt[0];
632}632}
@@ -809,10 +809,10 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code · 176 unmodified lines
809 }809 }
810 }810 }
811 if (avctx->codec->pix_fmts) {811 if (avctx->codec->pix_fmts) {
812 for (i = 0; avctx->codec->pix_fmts[i] != PIX_FMT_NONE; i++)812 for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++)
813 if (avctx->pix_fmt == avctx->codec->pix_fmts[i])813 if (avctx->pix_fmt == avctx->codec->pix_fmts[i])
814 break;814 break;
815 if (avctx->codec->pix_fmts[i] == PIX_FMT_NONE) {815 if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE) {
816 av_log(avctx, AV_LOG_ERROR, "Specified pix_fmt is not supported\n");816 av_log(avctx, AV_LOG_ERROR, "Specified pix_fmt is not supported\n");
817 ret = AVERROR(EINVAL);817 ret = AVERROR(EINVAL);
818 goto free_and_end;818 goto free_and_end;
@@ -1621,7 +1621,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) · 802 unmodified lines
1621 if (profile)1621 if (profile)
1622 snprintf(buf + strlen(buf), buf_size - strlen(buf),1622 snprintf(buf + strlen(buf), buf_size - strlen(buf),
1623 " (%s)", profile);1623 " (%s)", profile);
1624 if (enc->pix_fmt != PIX_FMT_NONE) {1624 if (enc->pix_fmt != AV_PIX_FMT_NONE) {
1625 snprintf(buf + strlen(buf), buf_size - strlen(buf),1625 snprintf(buf + strlen(buf), buf_size - strlen(buf),
1626 ", %s",1626 ", %s",
1627 av_get_pix_fmt_name(enc->pix_fmt));1627 av_get_pix_fmt_name(enc->pix_fmt));
@@ -2067,7 +2067,7 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel) · 439 unmodified lines
2067 return hwaccel ? hwaccel->next : first_hwaccel;2067 return hwaccel ? hwaccel->next : first_hwaccel;
2068}2068}
2069 2069
2070AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum PixelFormat pix_fmt)2070AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt)
2071{2071{
2072 AVHWAccel *hwaccel = NULL;2072 AVHWAccel *hwaccel = NULL;
2073 2073
libavcodec/utvideodec.c+9−9
@@ -86,7 +86,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, · 85 unmodified lines
86 VLC vlc;86 VLC vlc;
87 GetBitContext gb;87 GetBitContext gb;
88 int prev, fsym;88 int prev, fsym;
89 const int cmask = ~(!plane_no && c->avctx->pix_fmt == PIX_FMT_YUV420P);89 const int cmask = ~(!plane_no && c->avctx->pix_fmt == AV_PIX_FMT_YUV420P);
90 90
91 if (build_huff(src, &vlc, &fsym)) {91 if (build_huff(src, &vlc, &fsym)) {
92 av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");92 av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");
@@ -393,8 +393,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 300 unmodified lines
393 }393 }
394 394
395 switch (c->avctx->pix_fmt) {395 switch (c->avctx->pix_fmt) {
396 case PIX_FMT_RGB24:396 case AV_PIX_FMT_RGB24:
397 case PIX_FMT_RGBA:397 case AV_PIX_FMT_RGBA:
398 for (i = 0; i < c->planes; i++) {398 for (i = 0; i < c->planes; i++) {
399 ret = decode_plane(c, i, c->pic.data[0] + ff_ut_rgb_order[i],399 ret = decode_plane(c, i, c->pic.data[0] + ff_ut_rgb_order[i],
400 c->planes, c->pic.linesize[0], avctx->width,400 c->planes, c->pic.linesize[0], avctx->width,
@@ -418,7 +418,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 17 unmodified lines
418 restore_rgb_planes(c->pic.data[0], c->planes, c->pic.linesize[0],418 restore_rgb_planes(c->pic.data[0], c->planes, c->pic.linesize[0],
419 avctx->width, avctx->height);419 avctx->width, avctx->height);
420 break;420 break;
421 case PIX_FMT_YUV420P:421 case AV_PIX_FMT_YUV420P:
422 for (i = 0; i < 3; i++) {422 for (i = 0; i < 3; i++) {
423 ret = decode_plane(c, i, c->pic.data[i], 1, c->pic.linesize[i],423 ret = decode_plane(c, i, c->pic.data[i], 1, c->pic.linesize[i],
424 avctx->width >> !!i, avctx->height >> !!i,424 avctx->width >> !!i, avctx->height >> !!i,
@@ -439,7 +439,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 14 unmodified lines
439 }439 }
440 }440 }
441 break;441 break;
442 case PIX_FMT_YUV422P:442 case AV_PIX_FMT_YUV422P:
443 for (i = 0; i < 3; i++) {443 for (i = 0; i < 3; i++) {
444 ret = decode_plane(c, i, c->pic.data[i], 1, c->pic.linesize[i],444 ret = decode_plane(c, i, c->pic.data[i], 1, c->pic.linesize[i],
445 avctx->width >> !!i, avctx->height,445 avctx->width >> !!i, avctx->height,
@@ -507,19 +507,19 @@ static av_cold int decode_init(AVCodecContext *avctx) · 61 unmodified lines
507 switch (avctx->codec_tag) {507 switch (avctx->codec_tag) {
508 case MKTAG('U', 'L', 'R', 'G'):508 case MKTAG('U', 'L', 'R', 'G'):
509 c->planes = 3;509 c->planes = 3;
510 avctx->pix_fmt = PIX_FMT_RGB24;510 avctx->pix_fmt = AV_PIX_FMT_RGB24;
511 break;511 break;
512 case MKTAG('U', 'L', 'R', 'A'):512 case MKTAG('U', 'L', 'R', 'A'):
513 c->planes = 4;513 c->planes = 4;
514 avctx->pix_fmt = PIX_FMT_RGBA;514 avctx->pix_fmt = AV_PIX_FMT_RGBA;
515 break;515 break;
516 case MKTAG('U', 'L', 'Y', '0'):516 case MKTAG('U', 'L', 'Y', '0'):
517 c->planes = 3;517 c->planes = 3;
518 avctx->pix_fmt = PIX_FMT_YUV420P;518 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
519 break;519 break;
520 case MKTAG('U', 'L', 'Y', '2'):520 case MKTAG('U', 'L', 'Y', '2'):
521 c->planes = 3;521 c->planes = 3;
522 avctx->pix_fmt = PIX_FMT_YUV422P;522 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
523 break;523 break;
524 default:524 default:
525 av_log(avctx, AV_LOG_ERROR, "Unknown Ut Video FOURCC provided (%08X)\n",525 av_log(avctx, AV_LOG_ERROR, "Unknown Ut Video FOURCC provided (%08X)\n",
libavcodec/utvideoenc.c+12−12
@@ -65,17 +65,17 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) · 64 unmodified lines
65 c->slice_stride = FFALIGN(avctx->width, 32);65 c->slice_stride = FFALIGN(avctx->width, 32);
66 66
67 switch (avctx->pix_fmt) {67 switch (avctx->pix_fmt) {
68 case PIX_FMT_RGB24:68 case AV_PIX_FMT_RGB24:
69 c->planes = 3;69 c->planes = 3;
70 avctx->codec_tag = MKTAG('U', 'L', 'R', 'G');70 avctx->codec_tag = MKTAG('U', 'L', 'R', 'G');
71 original_format = UTVIDEO_RGB;71 original_format = UTVIDEO_RGB;
72 break;72 break;
73 case PIX_FMT_RGBA:73 case AV_PIX_FMT_RGBA:
74 c->planes = 4;74 c->planes = 4;
75 avctx->codec_tag = MKTAG('U', 'L', 'R', 'A');75 avctx->codec_tag = MKTAG('U', 'L', 'R', 'A');
76 original_format = UTVIDEO_RGBA;76 original_format = UTVIDEO_RGBA;
77 break;77 break;
78 case PIX_FMT_YUV420P:78 case AV_PIX_FMT_YUV420P:
79 if (avctx->width & 1 || avctx->height & 1) {79 if (avctx->width & 1 || avctx->height & 1) {
80 av_log(avctx, AV_LOG_ERROR,80 av_log(avctx, AV_LOG_ERROR,
81 "4:2:0 video requires even width and height.\n");81 "4:2:0 video requires even width and height.\n");
@@ -85,7 +85,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) · 3 unmodified lines
85 avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');85 avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
86 original_format = UTVIDEO_420;86 original_format = UTVIDEO_420;
87 break;87 break;
88 case PIX_FMT_YUV422P:88 case AV_PIX_FMT_YUV422P:
89 if (avctx->width & 1) {89 if (avctx->width & 1) {
90 av_log(avctx, AV_LOG_ERROR,90 av_log(avctx, AV_LOG_ERROR,
91 "4:2:2 video requires even width.\n");91 "4:2:2 video requires even width.\n");
@@ -538,14 +538,14 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 446 unmodified lines
538 }538 }
539 539
540 /* In case of RGB, mangle the planes to Ut Video's format */540 /* In case of RGB, mangle the planes to Ut Video's format */
541 if (avctx->pix_fmt == PIX_FMT_RGBA || avctx->pix_fmt == PIX_FMT_RGB24)541 if (avctx->pix_fmt == AV_PIX_FMT_RGBA || avctx->pix_fmt == AV_PIX_FMT_RGB24)
542 mangle_rgb_planes(c->slice_buffer, c->slice_stride, pic->data[0],542 mangle_rgb_planes(c->slice_buffer, c->slice_stride, pic->data[0],
543 c->planes, pic->linesize[0], width, height);543 c->planes, pic->linesize[0], width, height);
544 544
545 /* Deal with the planes */545 /* Deal with the planes */
546 switch (avctx->pix_fmt) {546 switch (avctx->pix_fmt) {
547 case PIX_FMT_RGB24:547 case AV_PIX_FMT_RGB24:
548 case PIX_FMT_RGBA:548 case AV_PIX_FMT_RGBA:
549 for (i = 0; i < c->planes; i++) {549 for (i = 0; i < c->planes; i++) {
550 ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride,550 ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride,
551 c->slice_buffer[i], c->slice_stride,551 c->slice_buffer[i], c->slice_stride,
@@ -557,7 +557,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 5 unmodified lines
557 }557 }
558 }558 }
559 break;559 break;
560 case PIX_FMT_YUV422P:560 case AV_PIX_FMT_YUV422P:
561 for (i = 0; i < c->planes; i++) {561 for (i = 0; i < c->planes; i++) {
562 ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],562 ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
563 pic->linesize[i], width >> !!i, height, &pb);563 pic->linesize[i], width >> !!i, height, &pb);
@@ -568,7 +568,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 4 unmodified lines
568 }568 }
569 }569 }
570 break;570 break;
571 case PIX_FMT_YUV420P:571 case AV_PIX_FMT_YUV420P:
572 for (i = 0; i < c->planes; i++) {572 for (i = 0; i < c->planes; i++) {
573 ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],573 ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
574 pic->linesize[i], width >> !!i, height >> !!i,574 pic->linesize[i], width >> !!i, height >> !!i,
@@ -619,9 +619,9 @@ AVCodec ff_utvideo_encoder = { · 44 unmodified lines
619 .init = utvideo_encode_init,619 .init = utvideo_encode_init,
620 .encode2 = utvideo_encode_frame,620 .encode2 = utvideo_encode_frame,
621 .close = utvideo_encode_close,621 .close = utvideo_encode_close,
622 .pix_fmts = (const enum PixelFormat[]) {622 .pix_fmts = (const enum AVPixelFormat[]) {
623 PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_YUV422P,623 AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV422P,
624 PIX_FMT_YUV420P, PIX_FMT_NONE624 AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
625 },625 },
626 .long_name = NULL_IF_CONFIG_SMALL("Ut Video"),626 .long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
627};627};
libavcodec/v210dec.c+1−1
@@ -32,7 +32,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 31 unmodified lines
32 av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");32 av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
33 return -1;33 return -1;
34 }34 }
35 avctx->pix_fmt = PIX_FMT_YUV422P10;35 avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
36 avctx->bits_per_raw_sample = 10;36 avctx->bits_per_raw_sample = 10;
37 37
38 avctx->coded_frame = avcodec_alloc_frame();38 avctx->coded_frame = avcodec_alloc_frame();
libavcodec/v210enc.c+1−1
@@ -123,6 +123,6 @@ AVCodec ff_v210_encoder = { · 122 unmodified lines
123 .init = encode_init,123 .init = encode_init,
124 .encode2 = encode_frame,124 .encode2 = encode_frame,
125 .close = encode_close,125 .close = encode_close,
126 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV422P10, PIX_FMT_NONE },126 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE },
127 .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),127 .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),
128};128};
libavcodec/v210x.c+1−1
@@ -29,7 +29,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 28 unmodified lines
29 av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");29 av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
30 return -1;30 return -1;
31 }31 }
32 avctx->pix_fmt = PIX_FMT_YUV422P16;32 avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
33 avctx->bits_per_raw_sample= 10;33 avctx->bits_per_raw_sample= 10;
34 34
35 avctx->coded_frame= avcodec_alloc_frame();35 avctx->coded_frame= avcodec_alloc_frame();
libavcodec/v410dec.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27static av_cold int v410_decode_init(AVCodecContext *avctx)27static av_cold int v410_decode_init(AVCodecContext *avctx)
28{28{
29 avctx->pix_fmt = PIX_FMT_YUV444P10;29 avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
30 avctx->bits_per_raw_sample = 10;30 avctx->bits_per_raw_sample = 10;
31 31
32 if (avctx->width & 1) {32 if (avctx->width & 1) {
libavcodec/v410enc.c+1−1
@@ -96,6 +96,6 @@ AVCodec ff_v410_encoder = { · 95 unmodified lines
96 .init = v410_encode_init,96 .init = v410_encode_init,
97 .encode2 = v410_encode_frame,97 .encode2 = v410_encode_frame,
98 .close = v410_encode_close,98 .close = v410_encode_close,
99 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV444P10, PIX_FMT_NONE },99 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE },
100 .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"),100 .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"),
101};101};
libavcodec/vaapi_h264.c+1−1
@@ -340,7 +340,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = { · 339 unmodified lines
340 .name = "h264_vaapi",340 .name = "h264_vaapi",
341 .type = AVMEDIA_TYPE_VIDEO,341 .type = AVMEDIA_TYPE_VIDEO,
342 .id = AV_CODEC_ID_H264,342 .id = AV_CODEC_ID_H264,
343 .pix_fmt = PIX_FMT_VAAPI_VLD,343 .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
344 .start_frame = start_frame,344 .start_frame = start_frame,
345 .end_frame = end_frame,345 .end_frame = end_frame,
346 .decode_slice = decode_slice,346 .decode_slice = decode_slice,
libavcodec/vaapi_mpeg2.c+1−1
@@ -142,7 +142,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = { · 141 unmodified lines
142 .name = "mpeg2_vaapi",142 .name = "mpeg2_vaapi",
143 .type = AVMEDIA_TYPE_VIDEO,143 .type = AVMEDIA_TYPE_VIDEO,
144 .id = AV_CODEC_ID_MPEG2VIDEO,144 .id = AV_CODEC_ID_MPEG2VIDEO,
145 .pix_fmt = PIX_FMT_VAAPI_VLD,145 .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
146 .start_frame = vaapi_mpeg2_start_frame,146 .start_frame = vaapi_mpeg2_start_frame,
147 .end_frame = vaapi_mpeg2_end_frame,147 .end_frame = vaapi_mpeg2_end_frame,
148 .decode_slice = vaapi_mpeg2_decode_slice,148 .decode_slice = vaapi_mpeg2_decode_slice,
libavcodec/vaapi_mpeg4.c+2−2
@@ -154,7 +154,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = { · 153 unmodified lines
154 .name = "mpeg4_vaapi",154 .name = "mpeg4_vaapi",
155 .type = AVMEDIA_TYPE_VIDEO,155 .type = AVMEDIA_TYPE_VIDEO,
156 .id = AV_CODEC_ID_MPEG4,156 .id = AV_CODEC_ID_MPEG4,
157 .pix_fmt = PIX_FMT_VAAPI_VLD,157 .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
158 .start_frame = vaapi_mpeg4_start_frame,158 .start_frame = vaapi_mpeg4_start_frame,
159 .end_frame = vaapi_mpeg4_end_frame,159 .end_frame = vaapi_mpeg4_end_frame,
160 .decode_slice = vaapi_mpeg4_decode_slice,160 .decode_slice = vaapi_mpeg4_decode_slice,
@@ -166,7 +166,7 @@ AVHWAccel ff_h263_vaapi_hwaccel = { · 5 unmodified lines
166 .name = "h263_vaapi",166 .name = "h263_vaapi",
167 .type = AVMEDIA_TYPE_VIDEO,167 .type = AVMEDIA_TYPE_VIDEO,
168 .id = AV_CODEC_ID_H263,168 .id = AV_CODEC_ID_H263,
169 .pix_fmt = PIX_FMT_VAAPI_VLD,169 .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
170 .start_frame = vaapi_mpeg4_start_frame,170 .start_frame = vaapi_mpeg4_start_frame,
171 .end_frame = vaapi_mpeg4_end_frame,171 .end_frame = vaapi_mpeg4_end_frame,
172 .decode_slice = vaapi_mpeg4_decode_slice,172 .decode_slice = vaapi_mpeg4_decode_slice,
libavcodec/vaapi_vc1.c+2−2
@@ -345,7 +345,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = { · 344 unmodified lines
345 .name = "wmv3_vaapi",345 .name = "wmv3_vaapi",
346 .type = AVMEDIA_TYPE_VIDEO,346 .type = AVMEDIA_TYPE_VIDEO,
347 .id = AV_CODEC_ID_WMV3,347 .id = AV_CODEC_ID_WMV3,
348 .pix_fmt = PIX_FMT_VAAPI_VLD,348 .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
349 .start_frame = vaapi_vc1_start_frame,349 .start_frame = vaapi_vc1_start_frame,
350 .end_frame = vaapi_vc1_end_frame,350 .end_frame = vaapi_vc1_end_frame,
351 .decode_slice = vaapi_vc1_decode_slice,351 .decode_slice = vaapi_vc1_decode_slice,
@@ -356,7 +356,7 @@ AVHWAccel ff_vc1_vaapi_hwaccel = { · 4 unmodified lines
356 .name = "vc1_vaapi",356 .name = "vc1_vaapi",
357 .type = AVMEDIA_TYPE_VIDEO,357 .type = AVMEDIA_TYPE_VIDEO,
358 .id = AV_CODEC_ID_VC1,358 .id = AV_CODEC_ID_VC1,
359 .pix_fmt = PIX_FMT_VAAPI_VLD,359 .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
360 .start_frame = vaapi_vc1_start_frame,360 .start_frame = vaapi_vc1_start_frame,
361 .end_frame = vaapi_vc1_end_frame,361 .end_frame = vaapi_vc1_end_frame,
362 .decode_slice = vaapi_vc1_decode_slice,362 .decode_slice = vaapi_vc1_decode_slice,
libavcodec/vb.c+1−1
@@ -246,7 +246,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 245 unmodified lines
246 VBDecContext * const c = avctx->priv_data;246 VBDecContext * const c = avctx->priv_data;
247 247
248 c->avctx = avctx;248 c->avctx = avctx;
249 avctx->pix_fmt = PIX_FMT_PAL8;249 avctx->pix_fmt = AV_PIX_FMT_PAL8;
250 250
251 c->frame = av_mallocz(avctx->width * avctx->height);251 c->frame = av_mallocz(avctx->width * avctx->height);
252 c->prev_frame = av_mallocz(avctx->width * avctx->height);252 c->prev_frame = av_mallocz(avctx->width * avctx->height);
libavcodec/vble.c+1−1
@@ -193,7 +193,7 @@ static av_cold int vble_decode_init(AVCodecContext *avctx) · 192 unmodified lines
193 ctx->avctx = avctx;193 ctx->avctx = avctx;
194 ff_dsputil_init(&ctx->dsp, avctx);194 ff_dsputil_init(&ctx->dsp, avctx);
195 195
196 avctx->pix_fmt = PIX_FMT_YUV420P;196 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
197 avctx->bits_per_raw_sample = 8;197 avctx->bits_per_raw_sample = 8;
198 avctx->coded_frame = avcodec_alloc_frame();198 avctx->coded_frame = avcodec_alloc_frame();
199 199
libavcodec/vc1dec.c+5−5
@@ -5149,7 +5149,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 5148 unmodified lines
5149 if (!(avctx->flags & CODEC_FLAG_GRAY))5149 if (!(avctx->flags & CODEC_FLAG_GRAY))
5150 avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);5150 avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
5151 else5151 else
5152 avctx->pix_fmt = PIX_FMT_GRAY8;5152 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
5153 avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);5153 avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
5154 v->s.avctx = avctx;5154 v->s.avctx = avctx;
5155 avctx->flags |= CODEC_FLAG_EMU_EDGE;5155 avctx->flags |= CODEC_FLAG_EMU_EDGE;
@@ -5336,9 +5336,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, · 180 unmodified lines
5336 5336
5337 if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) {5337 if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) {
5338 if (v->profile < PROFILE_ADVANCED)5338 if (v->profile < PROFILE_ADVANCED)
5339 avctx->pix_fmt = PIX_FMT_VDPAU_WMV3;5339 avctx->pix_fmt = AV_PIX_FMT_VDPAU_WMV3;
5340 else5340 else
5341 avctx->pix_fmt = PIX_FMT_VDPAU_VC1;5341 avctx->pix_fmt = AV_PIX_FMT_VDPAU_VC1;
5342 }5342 }
5343 5343
5344 //for advanced profile we may need to parse and unescape data5344 //for advanced profile we may need to parse and unescape data
@@ -5722,7 +5722,7 @@ AVCodec ff_wmv3_vdpau_decoder = { · 377 unmodified lines
5722 .decode = vc1_decode_frame,5722 .decode = vc1_decode_frame,
5723 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,5723 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
5724 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 VDPAU"),5724 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 VDPAU"),
5725 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_VDPAU_WMV3, PIX_FMT_NONE },5725 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_WMV3, AV_PIX_FMT_NONE },
5726 .profiles = NULL_IF_CONFIG_SMALL(profiles)5726 .profiles = NULL_IF_CONFIG_SMALL(profiles)
5727};5727};
5728#endif5728#endif
@@ -5738,7 +5738,7 @@ AVCodec ff_vc1_vdpau_decoder = { · 9 unmodified lines
5738 .decode = vc1_decode_frame,5738 .decode = vc1_decode_frame,
5739 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,5739 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
5740 .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 VDPAU"),5740 .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 VDPAU"),
5741 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_VDPAU_VC1, PIX_FMT_NONE },5741 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_VC1, AV_PIX_FMT_NONE },
5742 .profiles = NULL_IF_CONFIG_SMALL(profiles)5742 .profiles = NULL_IF_CONFIG_SMALL(profiles)
5743};5743};
5744#endif5744#endif
libavcodec/vcr1.c+1−1
@@ -47,7 +47,7 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx) · 46 unmodified lines
47{47{
48 vcr1_common_init(avctx);48 vcr1_common_init(avctx);
49 49
50 avctx->pix_fmt = PIX_FMT_YUV410P;50 avctx->pix_fmt = AV_PIX_FMT_YUV410P;
51 51
52 return 0;52 return 0;
53}53}
libavcodec/vda_h264.c+1−1
@@ -371,7 +371,7 @@ AVHWAccel ff_h264_vda_hwaccel = { · 370 unmodified lines
371 .name = "h264_vda",371 .name = "h264_vda",
372 .type = AVMEDIA_TYPE_VIDEO,372 .type = AVMEDIA_TYPE_VIDEO,
373 .id = AV_CODEC_ID_H264,373 .id = AV_CODEC_ID_H264,
374 .pix_fmt = PIX_FMT_VDA_VLD,374 .pix_fmt = AV_PIX_FMT_VDA_VLD,
375 .start_frame = start_frame,375 .start_frame = start_frame,
376 .decode_slice = decode_slice,376 .decode_slice = decode_slice,
377 .end_frame = end_frame,377 .end_frame = end_frame,
libavcodec/vmdav.c+1−1
@@ -388,7 +388,7 @@ static av_cold int vmdvideo_decode_init(AVCodecContext *avctx) · 387 unmodified lines
388 unsigned char *raw_palette;388 unsigned char *raw_palette;
389 389
390 s->avctx = avctx;390 s->avctx = avctx;
391 avctx->pix_fmt = PIX_FMT_PAL8;391 avctx->pix_fmt = AV_PIX_FMT_PAL8;
392 392
393 /* make sure the VMD header made it */393 /* make sure the VMD header made it */
394 if (s->avctx->extradata_size != VMD_HEADER_SIZE) {394 if (s->avctx->extradata_size != VMD_HEADER_SIZE) {
libavcodec/vmnc.c+3−3
@@ -474,13 +474,13 @@ static av_cold int decode_init(AVCodecContext *avctx) · 473 unmodified lines
474 474
475 switch(c->bpp){475 switch(c->bpp){
476 case 8:476 case 8:
477 avctx->pix_fmt = PIX_FMT_PAL8;477 avctx->pix_fmt = AV_PIX_FMT_PAL8;
478 break;478 break;
479 case 16:479 case 16:
480 avctx->pix_fmt = PIX_FMT_RGB555;480 avctx->pix_fmt = AV_PIX_FMT_RGB555;
481 break;481 break;
482 case 32:482 case 32:
483 avctx->pix_fmt = PIX_FMT_RGB32;483 avctx->pix_fmt = AV_PIX_FMT_RGB32;
484 break;484 break;
485 default:485 default:
486 av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", c->bpp);486 av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", c->bpp);
libavcodec/vp3.c+4−4
@@ -1673,8 +1673,8 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) · 1672 unmodified lines
1673 s->avctx = avctx;1673 s->avctx = avctx;
1674 s->width = FFALIGN(avctx->width, 16);1674 s->width = FFALIGN(avctx->width, 16);
1675 s->height = FFALIGN(avctx->height, 16);1675 s->height = FFALIGN(avctx->height, 16);
1676 if (avctx->pix_fmt == PIX_FMT_NONE)1676 if (avctx->pix_fmt == AV_PIX_FMT_NONE)
1677 avctx->pix_fmt = PIX_FMT_YUV420P;1677 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
1678 avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;1678 avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
1679 ff_dsputil_init(&s->dsp, avctx);1679 ff_dsputil_init(&s->dsp, avctx);
1680 ff_vp3dsp_init(&s->vp3dsp, avctx->flags);1680 ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
@@ -2115,8 +2115,8 @@ static int vp3_init_thread_copy(AVCodecContext *avctx) · 434 unmodified lines
2115}2115}
2116 2116
2117#if CONFIG_THEORA_DECODER2117#if CONFIG_THEORA_DECODER
2118static const enum PixelFormat theora_pix_fmts[4] = {2118static const enum AVPixelFormat theora_pix_fmts[4] = {
2119 PIX_FMT_YUV420P, PIX_FMT_NONE, PIX_FMT_YUV422P, PIX_FMT_YUV444P2119 AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P
2120};2120};
2121 2121
2122static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)2122static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
libavcodec/vp56.c+1−1
@@ -664,7 +664,7 @@ av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha) · 663 unmodified lines
664 int i;664 int i;
665 665
666 s->avctx = avctx;666 s->avctx = avctx;
667 avctx->pix_fmt = has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P;667 avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
668 668
669 ff_dsputil_init(&s->dsp, avctx);669 ff_dsputil_init(&s->dsp, avctx);
670 ff_vp3dsp_init(&s->vp3dsp, avctx->flags);670 ff_vp3dsp_init(&s->vp3dsp, avctx->flags);
libavcodec/vp8.c+1−1
@@ -2016,7 +2016,7 @@ static av_cold int vp8_decode_init(AVCodecContext *avctx) · 2015 unmodified lines
2016 VP8Context *s = avctx->priv_data;2016 VP8Context *s = avctx->priv_data;
2017 2017
2018 s->avctx = avctx;2018 s->avctx = avctx;
2019 avctx->pix_fmt = PIX_FMT_YUV420P;2019 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
2020 2020
2021 ff_dsputil_init(&s->dsp, avctx);2021 ff_dsputil_init(&s->dsp, avctx);
2022 ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);2022 ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1);
libavcodec/vqavideo.c+1−1
@@ -124,7 +124,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx) · 123 unmodified lines
124 int i, j, codebook_index;124 int i, j, codebook_index;
125 125
126 s->avctx = avctx;126 s->avctx = avctx;
127 avctx->pix_fmt = PIX_FMT_PAL8;127 avctx->pix_fmt = AV_PIX_FMT_PAL8;
128 128
129 /* make sure the extradata made it */129 /* make sure the extradata made it */
130 if (s->avctx->extradata_size != VQA_HEADER_SIZE) {130 if (s->avctx->extradata_size != VQA_HEADER_SIZE) {
libavcodec/wmv2enc.c+1−1
@@ -219,6 +219,6 @@ AVCodec ff_wmv2_encoder = { · 218 unmodified lines
219 .init = wmv2_encode_init,219 .init = wmv2_encode_init,
220 .encode2 = ff_MPV_encode_picture,220 .encode2 = ff_MPV_encode_picture,
221 .close = ff_MPV_encode_end,221 .close = ff_MPV_encode_end,
222 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE },222 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
223 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),223 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"),
224};224};
libavcodec/wnv1.c+1−1
@@ -135,7 +135,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ · 134 unmodified lines
135 static VLC_TYPE code_table[1 << CODE_VLC_BITS][2];135 static VLC_TYPE code_table[1 << CODE_VLC_BITS][2];
136 136
137 l->avctx = avctx;137 l->avctx = avctx;
138 avctx->pix_fmt = PIX_FMT_YUV422P;138 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
139 139
140 code_vlc.table = code_table;140 code_vlc.table = code_table;
141 code_vlc.table_allocated = 1 << CODE_VLC_BITS;141 code_vlc.table_allocated = 1 << CODE_VLC_BITS;
libavcodec/xan.c+1−1
@@ -79,7 +79,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx) · 78 unmodified lines
79 s->avctx = avctx;79 s->avctx = avctx;
80 s->frame_size = 0;80 s->frame_size = 0;
81 81
82 avctx->pix_fmt = PIX_FMT_PAL8;82 avctx->pix_fmt = AV_PIX_FMT_PAL8;
83 83
84 s->buffer1_size = avctx->width * avctx->height;84 s->buffer1_size = avctx->width * avctx->height;
85 s->buffer1 = av_malloc(s->buffer1_size);85 s->buffer1 = av_malloc(s->buffer1_size);
libavcodec/xbmenc.c+2−2
@@ -81,7 +81,7 @@ AVCodec ff_xbm_encoder = { · 80 unmodified lines
81 .init = xbm_encode_init,81 .init = xbm_encode_init,
82 .encode2 = xbm_encode_frame,82 .encode2 = xbm_encode_frame,
83 .close = xbm_encode_close,83 .close = xbm_encode_close,
84 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_MONOWHITE,84 .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE,
85 PIX_FMT_NONE },85 AV_PIX_FMT_NONE },
86 .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),86 .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
87};87};
libavcodec/xl.c+1−1
@@ -130,7 +130,7 @@ static int decode_frame(AVCodecContext *avctx, · 129 unmodified lines
130static av_cold int decode_init(AVCodecContext *avctx){130static av_cold int decode_init(AVCodecContext *avctx){
131// VideoXLContext * const a = avctx->priv_data;131// VideoXLContext * const a = avctx->priv_data;
132 132
133 avctx->pix_fmt= PIX_FMT_YUV411P;133 avctx->pix_fmt= AV_PIX_FMT_YUV411P;
134 134
135 return 0;135 return 0;
136}136}
libavcodec/xsubdec.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include "bytestream.h"26#include "bytestream.h"
27 27
28static av_cold int decode_init(AVCodecContext *avctx) {28static av_cold int decode_init(AVCodecContext *avctx) {
29 avctx->pix_fmt = PIX_FMT_PAL8;29 avctx->pix_fmt = AV_PIX_FMT_PAL8;
30 return 0;30 return 0;
31}31}
32 32
libavcodec/xwddec.c+13−13
@@ -153,19 +153,19 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 152 unmodified lines
153 return AVERROR_PATCHWELCOME;153 return AVERROR_PATCHWELCOME;
154 }154 }
155 155
156 avctx->pix_fmt = PIX_FMT_NONE;156 avctx->pix_fmt = AV_PIX_FMT_NONE;
157 switch (vclass) {157 switch (vclass) {
158 case XWD_STATIC_GRAY:158 case XWD_STATIC_GRAY:
159 case XWD_GRAY_SCALE:159 case XWD_GRAY_SCALE:
160 if (bpp != 1)160 if (bpp != 1)
161 return AVERROR_INVALIDDATA;161 return AVERROR_INVALIDDATA;
162 if (pixdepth == 1)162 if (pixdepth == 1)
163 avctx->pix_fmt = PIX_FMT_MONOWHITE;163 avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
164 break;164 break;
165 case XWD_STATIC_COLOR:165 case XWD_STATIC_COLOR:
166 case XWD_PSEUDO_COLOR:166 case XWD_PSEUDO_COLOR:
167 if (bpp == 8)167 if (bpp == 8)
168 avctx->pix_fmt = PIX_FMT_PAL8;168 avctx->pix_fmt = AV_PIX_FMT_PAL8;
169 break;169 break;
170 case XWD_TRUE_COLOR:170 case XWD_TRUE_COLOR:
171 case XWD_DIRECT_COLOR:171 case XWD_DIRECT_COLOR:
@@ -173,24 +173,24 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 1 unmodified line
173 return AVERROR_INVALIDDATA;173 return AVERROR_INVALIDDATA;
174 if (bpp == 16 && pixdepth == 15) {174 if (bpp == 16 && pixdepth == 15) {
175 if (rgb[0] == 0x7C00 && rgb[1] == 0x3E0 && rgb[2] == 0x1F)175 if (rgb[0] == 0x7C00 && rgb[1] == 0x3E0 && rgb[2] == 0x1F)
176 avctx->pix_fmt = be ? PIX_FMT_RGB555BE : PIX_FMT_RGB555LE;176 avctx->pix_fmt = be ? AV_PIX_FMT_RGB555BE : AV_PIX_FMT_RGB555LE;
177 else if (rgb[0] == 0x1F && rgb[1] == 0x3E0 && rgb[2] == 0x7C00)177 else if (rgb[0] == 0x1F && rgb[1] == 0x3E0 && rgb[2] == 0x7C00)
178 avctx->pix_fmt = be ? PIX_FMT_BGR555BE : PIX_FMT_BGR555LE;178 avctx->pix_fmt = be ? AV_PIX_FMT_BGR555BE : AV_PIX_FMT_BGR555LE;
179 } else if (bpp == 16 && pixdepth == 16) {179 } else if (bpp == 16 && pixdepth == 16) {
180 if (rgb[0] == 0xF800 && rgb[1] == 0x7E0 && rgb[2] == 0x1F)180 if (rgb[0] == 0xF800 && rgb[1] == 0x7E0 && rgb[2] == 0x1F)
181 avctx->pix_fmt = be ? PIX_FMT_RGB565BE : PIX_FMT_RGB565LE;181 avctx->pix_fmt = be ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_RGB565LE;
182 else if (rgb[0] == 0x1F && rgb[1] == 0x7E0 && rgb[2] == 0xF800)182 else if (rgb[0] == 0x1F && rgb[1] == 0x7E0 && rgb[2] == 0xF800)
183 avctx->pix_fmt = be ? PIX_FMT_BGR565BE : PIX_FMT_BGR565LE;183 avctx->pix_fmt = be ? AV_PIX_FMT_BGR565BE : AV_PIX_FMT_BGR565LE;
184 } else if (bpp == 24) {184 } else if (bpp == 24) {
185 if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF)185 if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF)
186 avctx->pix_fmt = be ? PIX_FMT_RGB24 : PIX_FMT_BGR24;186 avctx->pix_fmt = be ? AV_PIX_FMT_RGB24 : AV_PIX_FMT_BGR24;
187 else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)187 else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)
188 avctx->pix_fmt = be ? PIX_FMT_BGR24 : PIX_FMT_RGB24;188 avctx->pix_fmt = be ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_RGB24;
189 } else if (bpp == 32) {189 } else if (bpp == 32) {
190 if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF)190 if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF)
191 avctx->pix_fmt = be ? PIX_FMT_ARGB : PIX_FMT_BGRA;191 avctx->pix_fmt = be ? AV_PIX_FMT_ARGB : AV_PIX_FMT_BGRA;
192 else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)192 else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000)
193 avctx->pix_fmt = be ? PIX_FMT_ABGR : PIX_FMT_RGBA;193 avctx->pix_fmt = be ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA;
194 }194 }
195 bytestream2_skipu(&gb, ncolors * XWD_CMAP_SIZE);195 bytestream2_skipu(&gb, ncolors * XWD_CMAP_SIZE);
196 break;196 break;
@@ -199,7 +199,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 2 unmodified lines
199 return AVERROR_INVALIDDATA;199 return AVERROR_INVALIDDATA;
200 }200 }
201 201
202 if (avctx->pix_fmt == PIX_FMT_NONE) {202 if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
203 av_log_ask_for_sample(avctx, "unknown file: bpp %d, pixdepth %d, vclass %d\n", bpp, pixdepth, vclass);203 av_log_ask_for_sample(avctx, "unknown file: bpp %d, pixdepth %d, vclass %d\n", bpp, pixdepth, vclass);
204 return AVERROR_PATCHWELCOME;204 return AVERROR_PATCHWELCOME;
205 }205 }
@@ -216,7 +216,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, · 10 unmodified lines
216 p->key_frame = 1;216 p->key_frame = 1;
217 p->pict_type = AV_PICTURE_TYPE_I;217 p->pict_type = AV_PICTURE_TYPE_I;
218 218
219 if (avctx->pix_fmt == PIX_FMT_PAL8) {219 if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
220 uint32_t *dst = (uint32_t *)p->data[1];220 uint32_t *dst = (uint32_t *)p->data[1];
221 uint8_t red, green, blue;221 uint8_t red, green, blue;
222 222
libavcodec/xwdenc.c+51−51
@@ -42,7 +42,7 @@ static av_cold int xwd_encode_init(AVCodecContext *avctx) · 41 unmodified lines
42static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,42static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
43 const AVFrame *p, int *got_packet)43 const AVFrame *p, int *got_packet)
44{44{
45 enum PixelFormat pix_fmt = avctx->pix_fmt;45 enum AVPixelFormat pix_fmt = avctx->pix_fmt;
46 uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;46 uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
47 uint32_t rgb[3] = { 0 }, bitorder = 0;47 uint32_t rgb[3] = { 0 }, bitorder = 0;
48 uint32_t header_size;48 uint32_t header_size;
@@ -53,15 +53,15 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 4 unmodified lines
53 if (av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BE)53 if (av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BE)
54 be = 1;54 be = 1;
55 switch (pix_fmt) {55 switch (pix_fmt) {
56 case PIX_FMT_ARGB:56 case AV_PIX_FMT_ARGB:
57 case PIX_FMT_BGRA:57 case AV_PIX_FMT_BGRA:
58 case PIX_FMT_RGBA:58 case AV_PIX_FMT_RGBA:
59 case PIX_FMT_ABGR:59 case AV_PIX_FMT_ABGR:
60 if (pix_fmt == PIX_FMT_ARGB ||60 if (pix_fmt == AV_PIX_FMT_ARGB ||
61 pix_fmt == PIX_FMT_ABGR)61 pix_fmt == AV_PIX_FMT_ABGR)
62 be = 1;62 be = 1;
63 if (pix_fmt == PIX_FMT_ABGR ||63 if (pix_fmt == AV_PIX_FMT_ABGR ||
64 pix_fmt == PIX_FMT_RGBA) {64 pix_fmt == AV_PIX_FMT_RGBA) {
65 rgb[0] = 0xFF;65 rgb[0] = 0xFF;
66 rgb[1] = 0xFF00;66 rgb[1] = 0xFF00;
67 rgb[2] = 0xFF0000;67 rgb[2] = 0xFF0000;
@@ -75,9 +75,9 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 7 unmodified lines
75 vclass = XWD_TRUE_COLOR;75 vclass = XWD_TRUE_COLOR;
76 bpad = 32;76 bpad = 32;
77 break;77 break;
78 case PIX_FMT_BGR24:78 case AV_PIX_FMT_BGR24:
79 case PIX_FMT_RGB24:79 case AV_PIX_FMT_RGB24:
80 if (pix_fmt == PIX_FMT_RGB24)80 if (pix_fmt == AV_PIX_FMT_RGB24)
81 be = 1;81 be = 1;
82 bpp = 24;82 bpp = 24;
83 vclass = XWD_TRUE_COLOR;83 vclass = XWD_TRUE_COLOR;
@@ -86,12 +86,12 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 2 unmodified lines
86 rgb[1] = 0xFF00;86 rgb[1] = 0xFF00;
87 rgb[2] = 0xFF;87 rgb[2] = 0xFF;
88 break;88 break;
89 case PIX_FMT_RGB565LE:89 case AV_PIX_FMT_RGB565LE:
90 case PIX_FMT_RGB565BE:90 case AV_PIX_FMT_RGB565BE:
91 case PIX_FMT_BGR565LE:91 case AV_PIX_FMT_BGR565LE:
92 case PIX_FMT_BGR565BE:92 case AV_PIX_FMT_BGR565BE:
93 if (pix_fmt == PIX_FMT_BGR565LE ||93 if (pix_fmt == AV_PIX_FMT_BGR565LE ||
94 pix_fmt == PIX_FMT_BGR565BE) {94 pix_fmt == AV_PIX_FMT_BGR565BE) {
95 rgb[0] = 0x1F;95 rgb[0] = 0x1F;
96 rgb[1] = 0x7E0;96 rgb[1] = 0x7E0;
97 rgb[2] = 0xF800;97 rgb[2] = 0xF800;
@@ -104,12 +104,12 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 6 unmodified lines
104 vclass = XWD_TRUE_COLOR;104 vclass = XWD_TRUE_COLOR;
105 bpad = 16;105 bpad = 16;
106 break;106 break;
107 case PIX_FMT_RGB555LE:107 case AV_PIX_FMT_RGB555LE:
108 case PIX_FMT_RGB555BE:108 case AV_PIX_FMT_RGB555BE:
109 case PIX_FMT_BGR555LE:109 case AV_PIX_FMT_BGR555LE:
110 case PIX_FMT_BGR555BE:110 case AV_PIX_FMT_BGR555BE:
111 if (pix_fmt == PIX_FMT_BGR555LE ||111 if (pix_fmt == AV_PIX_FMT_BGR555LE ||
112 pix_fmt == PIX_FMT_BGR555BE) {112 pix_fmt == AV_PIX_FMT_BGR555BE) {
113 rgb[0] = 0x1F;113 rgb[0] = 0x1F;
114 rgb[1] = 0x3E0;114 rgb[1] = 0x3E0;
115 rgb[2] = 0x7C00;115 rgb[2] = 0x7C00;
@@ -122,17 +122,17 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 6 unmodified lines
122 vclass = XWD_TRUE_COLOR;122 vclass = XWD_TRUE_COLOR;
123 bpad = 16;123 bpad = 16;
124 break;124 break;
125 case PIX_FMT_RGB8:125 case AV_PIX_FMT_RGB8:
126 case PIX_FMT_BGR8:126 case AV_PIX_FMT_BGR8:
127 case PIX_FMT_RGB4_BYTE:127 case AV_PIX_FMT_RGB4_BYTE:
128 case PIX_FMT_BGR4_BYTE:128 case AV_PIX_FMT_BGR4_BYTE:
129 case PIX_FMT_PAL8:129 case AV_PIX_FMT_PAL8:
130 bpp = 8;130 bpp = 8;
131 vclass = XWD_PSEUDO_COLOR;131 vclass = XWD_PSEUDO_COLOR;
132 bpad = 8;132 bpad = 8;
133 ncolors = 256;133 ncolors = 256;
134 break;134 break;
135 case PIX_FMT_MONOWHITE:135 case AV_PIX_FMT_MONOWHITE:
136 be = 1;136 be = 1;
137 bitorder = 1;137 bitorder = 1;
138 bpp = 1;138 bpp = 1;
@@ -226,26 +226,26 @@ AVCodec ff_xwd_encoder = { · 87 unmodified lines
226 .init = xwd_encode_init,226 .init = xwd_encode_init,
227 .encode2 = xwd_encode_frame,227 .encode2 = xwd_encode_frame,
228 .close = xwd_encode_close,228 .close = xwd_encode_close,
229 .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_BGRA,229 .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA,
230 PIX_FMT_RGBA,230 AV_PIX_FMT_RGBA,
231 PIX_FMT_ARGB,231 AV_PIX_FMT_ARGB,
232 PIX_FMT_ABGR,232 AV_PIX_FMT_ABGR,
233 PIX_FMT_RGB24,233 AV_PIX_FMT_RGB24,
234 PIX_FMT_BGR24,234 AV_PIX_FMT_BGR24,
235 PIX_FMT_RGB565BE,235 AV_PIX_FMT_RGB565BE,
236 PIX_FMT_RGB565LE,236 AV_PIX_FMT_RGB565LE,
237 PIX_FMT_BGR565BE,237 AV_PIX_FMT_BGR565BE,
238 PIX_FMT_BGR565LE,238 AV_PIX_FMT_BGR565LE,
239 PIX_FMT_RGB555BE,239 AV_PIX_FMT_RGB555BE,
240 PIX_FMT_RGB555LE,240 AV_PIX_FMT_RGB555LE,
241 PIX_FMT_BGR555BE,241 AV_PIX_FMT_BGR555BE,
242 PIX_FMT_BGR555LE,242 AV_PIX_FMT_BGR555LE,
243 PIX_FMT_RGB8,243 AV_PIX_FMT_RGB8,
244 PIX_FMT_BGR8,244 AV_PIX_FMT_BGR8,
245 PIX_FMT_RGB4_BYTE,245 AV_PIX_FMT_RGB4_BYTE,
246 PIX_FMT_BGR4_BYTE,246 AV_PIX_FMT_BGR4_BYTE,
247 PIX_FMT_PAL8,247 AV_PIX_FMT_PAL8,
248 PIX_FMT_MONOWHITE,248 AV_PIX_FMT_MONOWHITE,
249 PIX_FMT_NONE },249 AV_PIX_FMT_NONE },
250 .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),250 .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
251};251};
libavcodec/xxan.c+1−1
@@ -44,7 +44,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx) · 43 unmodified lines
44 44
45 s->avctx = avctx;45 s->avctx = avctx;
46 46
47 avctx->pix_fmt = PIX_FMT_YUV420P;47 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
48 48
49 s->buffer_size = avctx->width * avctx->height;49 s->buffer_size = avctx->width * avctx->height;
50 s->y_buffer = av_malloc(s->buffer_size);50 s->y_buffer = av_malloc(s->buffer_size);
libavcodec/yop.c+1−1
@@ -89,7 +89,7 @@ static av_cold int yop_decode_init(AVCodecContext *avctx) · 88 unmodified lines
89 return -1;89 return -1;
90 }90 }
91 91
92 avctx->pix_fmt = PIX_FMT_PAL8;92 avctx->pix_fmt = AV_PIX_FMT_PAL8;
93 93
94 s->num_pal_colors = avctx->extradata[0];94 s->num_pal_colors = avctx->extradata[0];
95 s->first_color[0] = avctx->extradata[1];95 s->first_color[0] = avctx->extradata[1];
libavcodec/zerocodec.c+1−1
@@ -129,7 +129,7 @@ static av_cold int zerocodec_decode_init(AVCodecContext *avctx) · 128 unmodified lines
129 z_stream *zstream = &zc->zstream;129 z_stream *zstream = &zc->zstream;
130 int zret;130 int zret;
131 131
132 avctx->pix_fmt = PIX_FMT_UYVY422;132 avctx->pix_fmt = AV_PIX_FMT_UYVY422;
133 avctx->bits_per_raw_sample = 8;133 avctx->bits_per_raw_sample = 8;
134 134
135 zc->size = avpicture_get_size(avctx->pix_fmt,135 zc->size = avpicture_get_size(avctx->pix_fmt,
libavcodec/zmbv.c+1−1
@@ -627,7 +627,7 @@ static av_cold int decode_init(AVCodecContext *avctx) · 626 unmodified lines
627 // Needed if zlib unused or init aborted before inflateInit627 // Needed if zlib unused or init aborted before inflateInit
628 memset(&c->zstream, 0, sizeof(z_stream));628 memset(&c->zstream, 0, sizeof(z_stream));
629 629
630 avctx->pix_fmt = PIX_FMT_RGB24;630 avctx->pix_fmt = AV_PIX_FMT_RGB24;
631 c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);631 c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
632 632
633 /* Allocate decompression buffer */633 /* Allocate decompression buffer */
libavcodec/zmbvenc.c+1−1
@@ -345,6 +345,6 @@ AVCodec ff_zmbv_encoder = { · 344 unmodified lines
345 .init = encode_init,345 .init = encode_init,
346 .encode2 = encode_frame,346 .encode2 = encode_frame,
347 .close = encode_end,347 .close = encode_end,
348 .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_PAL8, PIX_FMT_NONE },348 .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE },
349 .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),349 .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
350};350};
libavdevice/bktr.c+1−1
@@ -282,7 +282,7 @@ static int grab_read_header(AVFormatContext *s1) · 281 unmodified lines
282 s->per_frame = ((uint64_t)1000000 * framerate.den) / framerate.num;282 s->per_frame = ((uint64_t)1000000 * framerate.den) / framerate.num;
283 283
284 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;284 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
285 st->codec->pix_fmt = PIX_FMT_YUV420P;285 st->codec->pix_fmt = AV_PIX_FMT_YUV420P;
286 st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;286 st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
287 st->codec->width = width;287 st->codec->width = width;
288 st->codec->height = height;288 st->codec->height = height;
libavdevice/fbdev.c+11−11
@@ -48,20 +48,20 @@ · 47 unmodified lines
48struct rgb_pixfmt_map_entry {48struct rgb_pixfmt_map_entry {
49 int bits_per_pixel;49 int bits_per_pixel;
50 int red_offset, green_offset, blue_offset, alpha_offset;50 int red_offset, green_offset, blue_offset, alpha_offset;
51 enum PixelFormat pixfmt;51 enum AVPixelFormat pixfmt;
52};52};
53 53
54static struct rgb_pixfmt_map_entry rgb_pixfmt_map[] = {54static struct rgb_pixfmt_map_entry rgb_pixfmt_map[] = {
55 // bpp, red_offset, green_offset, blue_offset, alpha_offset, pixfmt55 // bpp, red_offset, green_offset, blue_offset, alpha_offset, pixfmt
56 { 32, 0, 8, 16, 24, PIX_FMT_RGBA },56 { 32, 0, 8, 16, 24, AV_PIX_FMT_RGBA },
57 { 32, 16, 8, 0, 24, PIX_FMT_BGRA },57 { 32, 16, 8, 0, 24, AV_PIX_FMT_BGRA },
58 { 32, 8, 16, 24, 0, PIX_FMT_ARGB },58 { 32, 8, 16, 24, 0, AV_PIX_FMT_ARGB },
59 { 32, 3, 2, 8, 0, PIX_FMT_ABGR },59 { 32, 3, 2, 8, 0, AV_PIX_FMT_ABGR },
60 { 24, 0, 8, 16, 0, PIX_FMT_RGB24 },60 { 24, 0, 8, 16, 0, AV_PIX_FMT_RGB24 },
61 { 24, 16, 8, 0, 0, PIX_FMT_BGR24 },61 { 24, 16, 8, 0, 0, AV_PIX_FMT_BGR24 },
62};62};
63 63
64static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)64static enum AVPixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo)
65{65{
66 int i;66 int i;
67 67
@@ -74,7 +74,7 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var · 6 unmodified lines
74 return entry->pixfmt;74 return entry->pixfmt;
75 }75 }
76 76
77 return PIX_FMT_NONE;77 return AV_PIX_FMT_NONE;
78}78}
79 79
80typedef struct {80typedef struct {
@@ -99,7 +99,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx) · 18 unmodified lines
99{99{
100 FBDevContext *fbdev = avctx->priv_data;100 FBDevContext *fbdev = avctx->priv_data;
101 AVStream *st = NULL;101 AVStream *st = NULL;
102 enum PixelFormat pix_fmt;102 enum AVPixelFormat pix_fmt;
103 int ret, flags = O_RDONLY;103 int ret, flags = O_RDONLY;
104 104
105 ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);105 ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate);
@@ -139,7 +139,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx) · 33 unmodified lines
139 }139 }
140 140
141 pix_fmt = get_pixfmt_from_fb_varinfo(&fbdev->varinfo);141 pix_fmt = get_pixfmt_from_fb_varinfo(&fbdev->varinfo);
142 if (pix_fmt == PIX_FMT_NONE) {142 if (pix_fmt == AV_PIX_FMT_NONE) {
143 ret = AVERROR(EINVAL);143 ret = AVERROR(EINVAL);
144 av_log(avctx, AV_LOG_ERROR,144 av_log(avctx, AV_LOG_ERROR,
145 "Framebuffer pixel format not supported.\n");145 "Framebuffer pixel format not supported.\n");
libavdevice/libdc1394.c+6−6
@@ -73,12 +73,12 @@ typedef struct dc1394_data { · 72 unmodified lines
73struct dc1394_frame_format {73struct dc1394_frame_format {
74 int width;74 int width;
75 int height;75 int height;
76 enum PixelFormat pix_fmt;76 enum AVPixelFormat pix_fmt;
77 int frame_size_id;77 int frame_size_id;
78} dc1394_frame_formats[] = {78} dc1394_frame_formats[] = {
79 { 320, 240, PIX_FMT_UYVY422, DC1394_VIDEO_MODE_320x240_YUV422 },79 { 320, 240, AV_PIX_FMT_UYVY422, DC1394_VIDEO_MODE_320x240_YUV422 },
80 { 640, 480, PIX_FMT_UYYVYY411, DC1394_VIDEO_MODE_640x480_YUV411 },80 { 640, 480, AV_PIX_FMT_UYYVYY411, DC1394_VIDEO_MODE_640x480_YUV411 },
81 { 640, 480, PIX_FMT_UYVY422, DC1394_VIDEO_MODE_640x480_YUV422 },81 { 640, 480, AV_PIX_FMT_UYVY422, DC1394_VIDEO_MODE_640x480_YUV422 },
82 { 0, 0, 0, 0 } /* gotta be the last one */82 { 0, 0, 0, 0 } /* gotta be the last one */
83};83};
84 84
@@ -124,12 +124,12 @@ static inline int dc1394_read_common(AVFormatContext *c, · 39 unmodified lines
124 AVStream* vst;124 AVStream* vst;
125 struct dc1394_frame_format *fmt;125 struct dc1394_frame_format *fmt;
126 struct dc1394_frame_rate *fps;126 struct dc1394_frame_rate *fps;
127 enum PixelFormat pix_fmt;127 enum AVPixelFormat pix_fmt;
128 int width, height;128 int width, height;
129 AVRational framerate;129 AVRational framerate;
130 int ret = 0;130 int ret = 0;
131 131
132 if ((pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == PIX_FMT_NONE) {132 if ((pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == AV_PIX_FMT_NONE) {
133 av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format);133 av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format);
134 ret = AVERROR(EINVAL);134 ret = AVERROR(EINVAL);
135 goto out;135 goto out;
libavdevice/v4l2.c+25−25
@@ -7,7 +7,7 @@ · 6 unmodified lines
7 * (http://v4l2spec.bytesex.org/v4l2spec/capture.c)7 * (http://v4l2spec.bytesex.org/v4l2spec/capture.c)
8 *8 *
9 * Thanks to Michael Niedermayer for providing the mapping between9 * Thanks to Michael Niedermayer for providing the mapping between
10 * V4L2_PIX_FMT_* and PIX_FMT_*10 * V4L2_PIX_FMT_* and AV_PIX_FMT_*
11 *11 *
12 *12 *
13 * This file is part of Libav.13 * This file is part of Libav.
@@ -84,28 +84,28 @@ struct buff_data { · 70 unmodified lines
84};84};
85 85
86struct fmt_map {86struct fmt_map {
87 enum PixelFormat ff_fmt;87 enum AVPixelFormat ff_fmt;
88 enum AVCodecID codec_id;88 enum AVCodecID codec_id;
89 uint32_t v4l2_fmt;89 uint32_t v4l2_fmt;
90};90};
91 91
92static struct fmt_map fmt_conversion_table[] = {92static struct fmt_map fmt_conversion_table[] = {
93 //ff_fmt codec_id v4l2_fmt93 //ff_fmt codec_id v4l2_fmt
94 { PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 },94 { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 },
95 { PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P },95 { AV_PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P },
96 { PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV },96 { AV_PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV },
97 { PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY },97 { AV_PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY },
98 { PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P },98 { AV_PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P },
99 { PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 },99 { AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 },
100 { PIX_FMT_RGB555, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 },100 { AV_PIX_FMT_RGB555, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 },
101 { PIX_FMT_RGB565, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 },101 { AV_PIX_FMT_RGB565, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 },
102 { PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 },102 { AV_PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 },
103 { PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 },103 { AV_PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 },
104 { PIX_FMT_BGRA, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 },104 { AV_PIX_FMT_BGRA, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 },
105 { PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY },105 { AV_PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY },
106 { PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 },106 { AV_PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 },
107 { PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG },107 { AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG },
108 { PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG },108 { AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG },
109};109};
110 110
111static int device_open(AVFormatContext *ctx)111static int device_open(AVFormatContext *ctx)
@@ -220,14 +220,14 @@ static int first_field(int fd) · 108 unmodified lines
220 return 1;220 return 1;
221}221}
222 222
223static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum AVCodecID codec_id)223static uint32_t fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id)
224{224{
225 int i;225 int i;
226 226
227 for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {227 for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
228 if ((codec_id == AV_CODEC_ID_NONE ||228 if ((codec_id == AV_CODEC_ID_NONE ||
229 fmt_conversion_table[i].codec_id == codec_id) &&229 fmt_conversion_table[i].codec_id == codec_id) &&
230 (pix_fmt == PIX_FMT_NONE ||230 (pix_fmt == AV_PIX_FMT_NONE ||
231 fmt_conversion_table[i].ff_fmt == pix_fmt)) {231 fmt_conversion_table[i].ff_fmt == pix_fmt)) {
232 return fmt_conversion_table[i].v4l2_fmt;232 return fmt_conversion_table[i].v4l2_fmt;
233 }233 }
@@ -236,7 +236,7 @@ static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum AVCodecID codec_id) · 2 unmodified lines
236 return 0;236 return 0;
237}237}
238 238
239static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)239static enum AVPixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)
240{240{
241 int i;241 int i;
242 242
@@ -247,7 +247,7 @@ static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id) · 4 unmodified lines
247 }247 }
248 }248 }
249 249
250 return PIX_FMT_NONE;250 return AV_PIX_FMT_NONE;
251}251}
252 252
253static enum AVCodecID fmt_v4l2codec(uint32_t v4l2_fmt)253static enum AVCodecID fmt_v4l2codec(uint32_t v4l2_fmt)
@@ -295,7 +295,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type) · 41 unmodified lines
295 295
296 while(!ioctl(fd, VIDIOC_ENUM_FMT, &vfd)) {296 while(!ioctl(fd, VIDIOC_ENUM_FMT, &vfd)) {
297 enum AVCodecID codec_id = fmt_v4l2codec(vfd.pixelformat);297 enum AVCodecID codec_id = fmt_v4l2codec(vfd.pixelformat);
298 enum PixelFormat pix_fmt = fmt_v4l2ff(vfd.pixelformat, codec_id);298 enum AVPixelFormat pix_fmt = fmt_v4l2ff(vfd.pixelformat, codec_id);
299 299
300 vfd.index++;300 vfd.index++;
301 301
@@ -645,7 +645,7 @@ static int v4l2_set_parameters(AVFormatContext *s1) · 343 unmodified lines
645}645}
646 646
647static uint32_t device_try_init(AVFormatContext *s1,647static uint32_t device_try_init(AVFormatContext *s1,
648 enum PixelFormat pix_fmt,648 enum AVPixelFormat pix_fmt,
649 int *width,649 int *width,
650 int *height,650 int *height,
651 enum AVCodecID *codec_id)651 enum AVCodecID *codec_id)
@@ -684,7 +684,7 @@ static int v4l2_read_header(AVFormatContext *s1) · 32 unmodified lines
684 int res = 0;684 int res = 0;
685 uint32_t desired_format;685 uint32_t desired_format;
686 enum AVCodecID codec_id;686 enum AVCodecID codec_id;
687 enum PixelFormat pix_fmt = PIX_FMT_NONE;687 enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
688 688
689 st = avformat_new_stream(s1, NULL);689 st = avformat_new_stream(s1, NULL);
690 if (!st) {690 if (!st) {
@@ -721,7 +721,7 @@ static int v4l2_read_header(AVFormatContext *s1) · 30 unmodified lines
721 721
722 pix_fmt = av_get_pix_fmt(s->pixel_format);722 pix_fmt = av_get_pix_fmt(s->pixel_format);
723 723
724 if (pix_fmt == PIX_FMT_NONE && !codec) {724 if (pix_fmt == AV_PIX_FMT_NONE && !codec) {
725 av_log(s1, AV_LOG_ERROR, "No such input format: %s.\n",725 av_log(s1, AV_LOG_ERROR, "No such input format: %s.\n",
726 s->pixel_format);726 s->pixel_format);
727 727
libavdevice/vfwcap.c+12−12
@@ -47,32 +47,32 @@ struct vfw_ctx { · 46 unmodified lines
47 char *framerate; /**< Set by a private option. */47 char *framerate; /**< Set by a private option. */
48};48};
49 49
50static enum PixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount)50static enum AVPixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount)
51{51{
52 switch(biCompression) {52 switch(biCompression) {
53 case MKTAG('U', 'Y', 'V', 'Y'):53 case MKTAG('U', 'Y', 'V', 'Y'):
54 return PIX_FMT_UYVY422;54 return AV_PIX_FMT_UYVY422;
55 case MKTAG('Y', 'U', 'Y', '2'):55 case MKTAG('Y', 'U', 'Y', '2'):
56 return PIX_FMT_YUYV422;56 return AV_PIX_FMT_YUYV422;
57 case MKTAG('I', '4', '2', '0'):57 case MKTAG('I', '4', '2', '0'):
58 return PIX_FMT_YUV420P;58 return AV_PIX_FMT_YUV420P;
59 case BI_RGB:59 case BI_RGB:
60 switch(biBitCount) { /* 1-8 are untested */60 switch(biBitCount) { /* 1-8 are untested */
61 case 1:61 case 1:
62 return PIX_FMT_MONOWHITE;62 return AV_PIX_FMT_MONOWHITE;
63 case 4:63 case 4:
64 return PIX_FMT_RGB4;64 return AV_PIX_FMT_RGB4;
65 case 8:65 case 8:
66 return PIX_FMT_RGB8;66 return AV_PIX_FMT_RGB8;
67 case 16:67 case 16:
68 return PIX_FMT_RGB555;68 return AV_PIX_FMT_RGB555;
69 case 24:69 case 24:
70 return PIX_FMT_BGR24;70 return AV_PIX_FMT_BGR24;
71 case 32:71 case 32:
72 return PIX_FMT_RGB32;72 return AV_PIX_FMT_RGB32;
73 }73 }
74 }74 }
75 return PIX_FMT_NONE;75 return AV_PIX_FMT_NONE;
76}76}
77 77
78static enum AVCodecID vfw_codecid(DWORD biCompression)78static enum AVCodecID vfw_codecid(DWORD biCompression)
@@ -376,7 +376,7 @@ static int vfw_read_header(AVFormatContext *s) · 297 unmodified lines
376 codec->width = bi->bmiHeader.biWidth;376 codec->width = bi->bmiHeader.biWidth;
377 codec->height = bi->bmiHeader.biHeight;377 codec->height = bi->bmiHeader.biHeight;
378 codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount);378 codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount);
379 if(codec->pix_fmt == PIX_FMT_NONE) {379 if(codec->pix_fmt == AV_PIX_FMT_NONE) {
380 codec->codec_id = vfw_codecid(biCompression);380 codec->codec_id = vfw_codecid(biCompression);
381 if(codec->codec_id == AV_CODEC_ID_NONE) {381 if(codec->codec_id == AV_CODEC_ID_NONE) {
382 av_log(s, AV_LOG_ERROR, "Unknown compression type. "382 av_log(s, AV_LOG_ERROR, "Unknown compression type. "
libavdevice/x11grab.c+7−7
@@ -158,7 +158,7 @@ x11grab_read_header(AVFormatContext *s1) · 157 unmodified lines
158 struct x11grab *x11grab = s1->priv_data;158 struct x11grab *x11grab = s1->priv_data;
159 Display *dpy;159 Display *dpy;
160 AVStream *st = NULL;160 AVStream *st = NULL;
161 enum PixelFormat input_pixfmt;161 enum AVPixelFormat input_pixfmt;
162 XImage *image;162 XImage *image;
163 int x_off = 0;163 int x_off = 0;
164 int y_off = 0;164 int y_off = 0;
@@ -259,19 +259,19 @@ x11grab_read_header(AVFormatContext *s1) · 94 unmodified lines
259 switch (image->bits_per_pixel) {259 switch (image->bits_per_pixel) {
260 case 8:260 case 8:
261 av_log (s1, AV_LOG_DEBUG, "8 bit palette\n");261 av_log (s1, AV_LOG_DEBUG, "8 bit palette\n");
262 input_pixfmt = PIX_FMT_PAL8;262 input_pixfmt = AV_PIX_FMT_PAL8;
263 break;263 break;
264 case 16:264 case 16:
265 if ( image->red_mask == 0xf800 &&265 if ( image->red_mask == 0xf800 &&
266 image->green_mask == 0x07e0 &&266 image->green_mask == 0x07e0 &&
267 image->blue_mask == 0x001f ) {267 image->blue_mask == 0x001f ) {
268 av_log (s1, AV_LOG_DEBUG, "16 bit RGB565\n");268 av_log (s1, AV_LOG_DEBUG, "16 bit RGB565\n");
269 input_pixfmt = PIX_FMT_RGB565;269 input_pixfmt = AV_PIX_FMT_RGB565;
270 } else if (image->red_mask == 0x7c00 &&270 } else if (image->red_mask == 0x7c00 &&
271 image->green_mask == 0x03e0 &&271 image->green_mask == 0x03e0 &&
272 image->blue_mask == 0x001f ) {272 image->blue_mask == 0x001f ) {
273 av_log(s1, AV_LOG_DEBUG, "16 bit RGB555\n");273 av_log(s1, AV_LOG_DEBUG, "16 bit RGB555\n");
274 input_pixfmt = PIX_FMT_RGB555;274 input_pixfmt = AV_PIX_FMT_RGB555;
275 } else {275 } else {
276 av_log(s1, AV_LOG_ERROR, "RGB ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel);276 av_log(s1, AV_LOG_ERROR, "RGB ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel);
277 av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask);277 av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask);
@@ -283,11 +283,11 @@ x11grab_read_header(AVFormatContext *s1) · 5 unmodified lines
283 if ( image->red_mask == 0xff0000 &&283 if ( image->red_mask == 0xff0000 &&
284 image->green_mask == 0x00ff00 &&284 image->green_mask == 0x00ff00 &&
285 image->blue_mask == 0x0000ff ) {285 image->blue_mask == 0x0000ff ) {
286 input_pixfmt = PIX_FMT_BGR24;286 input_pixfmt = AV_PIX_FMT_BGR24;
287 } else if ( image->red_mask == 0x0000ff &&287 } else if ( image->red_mask == 0x0000ff &&
288 image->green_mask == 0x00ff00 &&288 image->green_mask == 0x00ff00 &&
289 image->blue_mask == 0xff0000 ) {289 image->blue_mask == 0xff0000 ) {
290 input_pixfmt = PIX_FMT_RGB24;290 input_pixfmt = AV_PIX_FMT_RGB24;
291 } else {291 } else {
292 av_log(s1, AV_LOG_ERROR,"rgb ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel);292 av_log(s1, AV_LOG_ERROR,"rgb ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel);
293 av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask);293 av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask);
@@ -296,7 +296,7 @@ x11grab_read_header(AVFormatContext *s1) · 2 unmodified lines
296 }296 }
297 break;297 break;
298 case 32:298 case 32:
299 input_pixfmt = PIX_FMT_RGB32;299 input_pixfmt = AV_PIX_FMT_RGB32;
300 break;300 break;
301 default:301 default:
302 av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel);302 av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel);
libavfilter/avfilter.c+1−1
@@ -90,7 +90,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 89 unmodified lines
90 link->srcpad = &src->output_pads[srcpad];90 link->srcpad = &src->output_pads[srcpad];
91 link->dstpad = &dst->input_pads[dstpad];91 link->dstpad = &dst->input_pads[dstpad];
92 link->type = src->output_pads[srcpad].type;92 link->type = src->output_pads[srcpad].type;
93 assert(PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);93 assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
94 link->format = -1;94 link->format = -1;
95 95
96 return 0;96 return 0;
libavfilter/avfilter.h+1−1
@@ -578,7 +578,7 @@ int avfilter_config_links(AVFilterContext *filter); · 577 unmodified lines
578 */578 */
579AVFilterBufferRef *579AVFilterBufferRef *
580avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms,580avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms,
581 int w, int h, enum PixelFormat format);581 int w, int h, enum AVPixelFormat format);
582 582
583/**583/**
584 * Create an audio buffer reference wrapped around an already584 * Create an audio buffer reference wrapped around an already
libavfilter/buffersrc.c+3−3
@@ -44,7 +44,7 @@ typedef struct { · 43 unmodified lines
44 44
45 /* video only */45 /* video only */
46 int h, w;46 int h, w;
47 enum PixelFormat pix_fmt;47 enum AVPixelFormat pix_fmt;
48 AVRational pixel_aspect;48 AVRational pixel_aspect;
49 49
50 /* audio only */50 /* audio only */
@@ -173,10 +173,10 @@ static av_cold int init_video(AVFilterContext *ctx, const char *args) · 122 unmodified lines
173 av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but %d found in '%s'\n", n, args);173 av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but %d found in '%s'\n", n, args);
174 return AVERROR(EINVAL);174 return AVERROR(EINVAL);
175 }175 }
176 if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) {176 if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == AV_PIX_FMT_NONE) {
177 char *tail;177 char *tail;
178 c->pix_fmt = strtol(pix_fmt_str, &tail, 10);178 c->pix_fmt = strtol(pix_fmt_str, &tail, 10);
179 if (*tail || c->pix_fmt < 0 || c->pix_fmt >= PIX_FMT_NB) {179 if (*tail || c->pix_fmt < 0 || c->pix_fmt >= AV_PIX_FMT_NB) {
180 av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", pix_fmt_str);180 av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", pix_fmt_str);
181 return AVERROR(EINVAL);181 return AVERROR(EINVAL);
182 }182 }
libavfilter/drawutils.c+7−7
@@ -27,7 +27,7 @@ · 26 unmodified lines
27enum { RED = 0, GREEN, BLUE, ALPHA };27enum { RED = 0, GREEN, BLUE, ALPHA };
28 28
29int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4],29int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4],
30 enum PixelFormat pix_fmt, uint8_t rgba_color[4],30 enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
31 int *is_packed_rgba, uint8_t rgba_map_ptr[4])31 int *is_packed_rgba, uint8_t rgba_map_ptr[4])
32{32{
33 uint8_t rgba_map[4] = {0};33 uint8_t rgba_map[4] = {0};
@@ -37,12 +37,12 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t · 3 unmodified lines
37 37
38 *is_packed_rgba = 1;38 *is_packed_rgba = 1;
39 switch (pix_fmt) {39 switch (pix_fmt) {
40 case PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;40 case AV_PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
41 case PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break;41 case AV_PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break;
42 case PIX_FMT_RGBA:42 case AV_PIX_FMT_RGBA:
43 case PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;43 case AV_PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break;
44 case PIX_FMT_BGRA:44 case AV_PIX_FMT_BGRA:
45 case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break;45 case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break;
46 default:46 default:
47 *is_packed_rgba = 0;47 *is_packed_rgba = 0;
48 }48 }
libavfilter/drawutils.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 29
30int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w,30int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w,
31 uint8_t dst_color[4],31 uint8_t dst_color[4],
32 enum PixelFormat pix_fmt, uint8_t rgba_color[4],32 enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
33 int *is_packed_rgba, uint8_t rgba_map[4]);33 int *is_packed_rgba, uint8_t rgba_map[4]);
34 34
35void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],35void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],
libavfilter/formats.c+2−2
@@ -155,7 +155,7 @@ int ff_fmt_is_in(int fmt, const int *fmts) · 154 unmodified lines
155{155{
156 const int *p;156 const int *p;
157 157
158 for (p = fmts; *p != PIX_FMT_NONE; p++) {158 for (p = fmts; *p != AV_PIX_FMT_NONE; p++) {
159 if (fmt == *p)159 if (fmt == *p)
160 return 1;160 return 1;
161 }161 }
@@ -210,7 +210,7 @@ AVFilterFormats *ff_all_formats(enum AVMediaType type) · 48 unmodified lines
210{210{
211 AVFilterFormats *ret = NULL;211 AVFilterFormats *ret = NULL;
212 int fmt;212 int fmt;
213 int num_formats = type == AVMEDIA_TYPE_VIDEO ? PIX_FMT_NB :213 int num_formats = type == AVMEDIA_TYPE_VIDEO ? AV_PIX_FMT_NB :
214 type == AVMEDIA_TYPE_AUDIO ? AV_SAMPLE_FMT_NB : 0;214 type == AVMEDIA_TYPE_AUDIO ? AV_SAMPLE_FMT_NB : 0;
215 215
216 for (fmt = 0; fmt < num_formats; fmt++)216 for (fmt = 0; fmt < num_formats; fmt++)
libavfilter/vf_blackframe.c+4−4
@@ -45,10 +45,10 @@ typedef struct { · 44 unmodified lines
45 45
46static int query_formats(AVFilterContext *ctx)46static int query_formats(AVFilterContext *ctx)
47{47{
48 static const enum PixelFormat pix_fmts[] = {48 static const enum AVPixelFormat pix_fmts[] = {
49 PIX_FMT_YUV410P, PIX_FMT_YUV420P, PIX_FMT_GRAY8, PIX_FMT_NV12,49 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12,
50 PIX_FMT_NV21, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P,50 AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
51 PIX_FMT_NONE51 AV_PIX_FMT_NONE
52 };52 };
53 53
54 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));54 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_boxblur.c+7−7
@@ -124,13 +124,13 @@ static av_cold void uninit(AVFilterContext *ctx) · 123 unmodified lines
124 124
125static int query_formats(AVFilterContext *ctx)125static int query_formats(AVFilterContext *ctx)
126{126{
127 enum PixelFormat pix_fmts[] = {127 enum AVPixelFormat pix_fmts[] = {
128 PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P,128 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
129 PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUVA420P,129 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P,
130 PIX_FMT_YUV440P, PIX_FMT_GRAY8,130 AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8,
131 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,131 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
132 PIX_FMT_YUVJ440P,132 AV_PIX_FMT_YUVJ440P,
133 PIX_FMT_NONE133 AV_PIX_FMT_NONE
134 };134 };
135 135
136 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));136 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_crop.c+24−24
@@ -85,30 +85,30 @@ typedef struct { · 84 unmodified lines
85 85
86static int query_formats(AVFilterContext *ctx)86static int query_formats(AVFilterContext *ctx)
87{87{
88 static const enum PixelFormat pix_fmts[] = {88 static const enum AVPixelFormat pix_fmts[] = {
89 PIX_FMT_RGB48BE, PIX_FMT_RGB48LE,89 AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48LE,
90 PIX_FMT_BGR48BE, PIX_FMT_BGR48LE,90 AV_PIX_FMT_BGR48BE, AV_PIX_FMT_BGR48LE,
91 PIX_FMT_ARGB, PIX_FMT_RGBA,91 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
92 PIX_FMT_ABGR, PIX_FMT_BGRA,92 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
93 PIX_FMT_RGB24, PIX_FMT_BGR24,93 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
94 PIX_FMT_RGB565BE, PIX_FMT_RGB565LE,94 AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE,
95 PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,95 AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE,
96 PIX_FMT_BGR565BE, PIX_FMT_BGR565LE,96 AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE,
97 PIX_FMT_BGR555BE, PIX_FMT_BGR555LE,97 AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE,
98 PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE,98 AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE,
99 PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE,99 AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE,
100 PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE,100 AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE,
101 PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE,101 AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE,
102 PIX_FMT_YUV444P, PIX_FMT_YUV422P,102 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
103 PIX_FMT_YUV420P, PIX_FMT_YUV411P,103 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
104 PIX_FMT_YUV410P, PIX_FMT_YUV440P,104 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
105 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,105 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
106 PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P,106 AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
107 PIX_FMT_YUVA420P,107 AV_PIX_FMT_YUVA420P,
108 PIX_FMT_RGB8, PIX_FMT_BGR8,108 AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8,
109 PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE,109 AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
110 PIX_FMT_PAL8, PIX_FMT_GRAY8,110 AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
111 PIX_FMT_NONE111 AV_PIX_FMT_NONE
112 };112 };
113 113
114 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));114 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_cropdetect.c+7−7
@@ -43,13 +43,13 @@ typedef struct { · 42 unmodified lines
43 43
44static int query_formats(AVFilterContext *ctx)44static int query_formats(AVFilterContext *ctx)
45{45{
46 static const enum PixelFormat pix_fmts[] = {46 static const enum AVPixelFormat pix_fmts[] = {
47 PIX_FMT_YUV420P, PIX_FMT_YUVJ420P,47 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
48 PIX_FMT_YUV422P, PIX_FMT_YUVJ422P,48 AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
49 PIX_FMT_YUV444P, PIX_FMT_YUVJ444P,49 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
50 PIX_FMT_YUV411P, PIX_FMT_GRAY8,50 AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8,
51 PIX_FMT_NV12, PIX_FMT_NV21,51 AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
52 PIX_FMT_NONE52 AV_PIX_FMT_NONE
53 };53 };
54 54
55 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));55 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_delogo.c+5−5
@@ -161,11 +161,11 @@ static const AVClass delogo_class = { · 160 unmodified lines
161 161
162static int query_formats(AVFilterContext *ctx)162static int query_formats(AVFilterContext *ctx)
163{163{
164 enum PixelFormat pix_fmts[] = {164 enum AVPixelFormat pix_fmts[] = {
165 PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P,165 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
166 PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUV440P,166 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
167 PIX_FMT_YUVA420P, PIX_FMT_GRAY8,167 AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
168 PIX_FMT_NONE168 AV_PIX_FMT_NONE
169 };169 };
170 170
171 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));171 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_drawbox.c+6−6
@@ -66,12 +66,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 65 unmodified lines
66 66
67static int query_formats(AVFilterContext *ctx)67static int query_formats(AVFilterContext *ctx)
68{68{
69 enum PixelFormat pix_fmts[] = {69 enum AVPixelFormat pix_fmts[] = {
70 PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P,70 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
71 PIX_FMT_YUV411P, PIX_FMT_YUV410P,71 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
72 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,72 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
73 PIX_FMT_YUV440P, PIX_FMT_YUVJ440P,73 AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
74 PIX_FMT_NONE74 AV_PIX_FMT_NONE
75 };75 };
76 76
77 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));77 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_drawtext.c+8−8
@@ -389,14 +389,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 388 unmodified lines
389 389
390static int query_formats(AVFilterContext *ctx)390static int query_formats(AVFilterContext *ctx)
391{391{
392 static const enum PixelFormat pix_fmts[] = {392 static const enum AVPixelFormat pix_fmts[] = {
393 PIX_FMT_ARGB, PIX_FMT_RGBA,393 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
394 PIX_FMT_ABGR, PIX_FMT_BGRA,394 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
395 PIX_FMT_RGB24, PIX_FMT_BGR24,395 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
396 PIX_FMT_YUV420P, PIX_FMT_YUV444P,396 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P,
397 PIX_FMT_YUV422P, PIX_FMT_YUV411P,397 AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
398 PIX_FMT_YUV410P, PIX_FMT_YUV440P,398 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
399 PIX_FMT_NONE399 AV_PIX_FMT_NONE
400 };400 };
401 401
402 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));402 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_fade.c+7−7
@@ -73,13 +73,13 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 72 unmodified lines
73 73
74static int query_formats(AVFilterContext *ctx)74static int query_formats(AVFilterContext *ctx)
75{75{
76 static const enum PixelFormat pix_fmts[] = {76 static const enum AVPixelFormat pix_fmts[] = {
77 PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P,77 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
78 PIX_FMT_YUV411P, PIX_FMT_YUV410P,78 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
79 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P,79 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
80 PIX_FMT_YUV440P, PIX_FMT_YUVJ440P,80 AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
81 PIX_FMT_RGB24, PIX_FMT_BGR24,81 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
82 PIX_FMT_NONE82 AV_PIX_FMT_NONE
83 };83 };
84 84
85 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));85 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_fieldorder.c+2−2
@@ -71,14 +71,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 70 unmodified lines
71static int query_formats(AVFilterContext *ctx)71static int query_formats(AVFilterContext *ctx)
72{72{
73 AVFilterFormats *formats;73 AVFilterFormats *formats;
74 enum PixelFormat pix_fmt;74 enum AVPixelFormat pix_fmt;
75 int ret;75 int ret;
76 76
77 /** accept any input pixel format that is not hardware accelerated, not77 /** accept any input pixel format that is not hardware accelerated, not
78 * a bitstream format, and does not have vertically sub-sampled chroma */78 * a bitstream format, and does not have vertically sub-sampled chroma */
79 if (ctx->inputs[0]) {79 if (ctx->inputs[0]) {
80 formats = NULL;80 formats = NULL;
81 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)81 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
82 if (!( av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL82 if (!( av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL
83 || av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BITSTREAM)83 || av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BITSTREAM)
84 && av_pix_fmt_descriptors[pix_fmt].nb_components84 && av_pix_fmt_descriptors[pix_fmt].nb_components
libavfilter/vf_format.c+9−9
@@ -38,18 +38,18 @@ typedef struct { · 37 unmodified lines
38 * List of flags telling if a given image format has been listed38 * List of flags telling if a given image format has been listed
39 * as argument to the filter.39 * as argument to the filter.
40 */40 */
41 int listed_pix_fmt_flags[PIX_FMT_NB];41 int listed_pix_fmt_flags[AV_PIX_FMT_NB];
42} FormatContext;42} FormatContext;
43 43
44#define PIX_FMT_NAME_MAXSIZE 3244#define AV_PIX_FMT_NAME_MAXSIZE 32
45 45
46static av_cold int init(AVFilterContext *ctx, const char *args)46static av_cold int init(AVFilterContext *ctx, const char *args)
47{47{
48 FormatContext *format = ctx->priv;48 FormatContext *format = ctx->priv;
49 const char *cur, *sep;49 const char *cur, *sep;
50 char pix_fmt_name[PIX_FMT_NAME_MAXSIZE];50 char pix_fmt_name[AV_PIX_FMT_NAME_MAXSIZE];
51 int pix_fmt_name_len;51 int pix_fmt_name_len;
52 enum PixelFormat pix_fmt;52 enum AVPixelFormat pix_fmt;
53 53
54 /* parse the list of formats */54 /* parse the list of formats */
55 for (cur = args; cur; cur = sep ? sep+1 : NULL) {55 for (cur = args; cur; cur = sep ? sep+1 : NULL) {
@@ -57,7 +57,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 1 unmodified line
57 pix_fmt_name_len = strlen(cur);57 pix_fmt_name_len = strlen(cur);
58 else58 else
59 pix_fmt_name_len = sep - cur;59 pix_fmt_name_len = sep - cur;
60 if (pix_fmt_name_len >= PIX_FMT_NAME_MAXSIZE) {60 if (pix_fmt_name_len >= AV_PIX_FMT_NAME_MAXSIZE) {
61 av_log(ctx, AV_LOG_ERROR, "Format name too long\n");61 av_log(ctx, AV_LOG_ERROR, "Format name too long\n");
62 return -1;62 return -1;
63 }63 }
@@ -66,7 +66,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 2 unmodified lines
66 pix_fmt_name[pix_fmt_name_len] = 0;66 pix_fmt_name[pix_fmt_name_len] = 0;
67 pix_fmt = av_get_pix_fmt(pix_fmt_name);67 pix_fmt = av_get_pix_fmt(pix_fmt_name);
68 68
69 if (pix_fmt == PIX_FMT_NONE) {69 if (pix_fmt == AV_PIX_FMT_NONE) {
70 av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name);70 av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name);
71 return -1;71 return -1;
72 }72 }
@@ -80,12 +80,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 7 unmodified lines
80static AVFilterFormats *make_format_list(FormatContext *format, int flag)80static AVFilterFormats *make_format_list(FormatContext *format, int flag)
81{81{
82 AVFilterFormats *formats;82 AVFilterFormats *formats;
83 enum PixelFormat pix_fmt;83 enum AVPixelFormat pix_fmt;
84 84
85 formats = av_mallocz(sizeof(AVFilterFormats));85 formats = av_mallocz(sizeof(AVFilterFormats));
86 formats->formats = av_malloc(sizeof(enum PixelFormat) * PIX_FMT_NB);86 formats->formats = av_malloc(sizeof(enum AVPixelFormat) * AV_PIX_FMT_NB);
87 87
88 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)88 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
89 if (format->listed_pix_fmt_flags[pix_fmt] == flag)89 if (format->listed_pix_fmt_flags[pix_fmt] == flag)
90 formats->formats[formats->format_count++] = pix_fmt;90 formats->formats[formats->format_count++] = pix_fmt;
91 91
libavfilter/vf_frei0r.c+4−4
@@ -329,12 +329,12 @@ static int query_formats(AVFilterContext *ctx) · 328 unmodified lines
329 AVFilterFormats *formats = NULL;329 AVFilterFormats *formats = NULL;
330 330
331 if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) {331 if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) {
332 ff_add_format(&formats, PIX_FMT_BGRA);332 ff_add_format(&formats, AV_PIX_FMT_BGRA);
333 } else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) {333 } else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) {
334 ff_add_format(&formats, PIX_FMT_RGBA);334 ff_add_format(&formats, AV_PIX_FMT_RGBA);
335 } else { /* F0R_COLOR_MODEL_PACKED32 */335 } else { /* F0R_COLOR_MODEL_PACKED32 */
336 static const enum PixelFormat pix_fmts[] = {336 static const enum AVPixelFormat pix_fmts[] = {
337 PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, PIX_FMT_ARGB, PIX_FMT_NONE337 AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE
338 };338 };
339 formats = ff_make_format_list(pix_fmts);339 formats = ff_make_format_list(pix_fmts);
340 }340 }
libavfilter/vf_gradfun.c+6−6
@@ -151,12 +151,12 @@ static av_cold void uninit(AVFilterContext *ctx) · 150 unmodified lines
151 151
152static int query_formats(AVFilterContext *ctx)152static int query_formats(AVFilterContext *ctx)
153{153{
154 static const enum PixelFormat pix_fmts[] = {154 static const enum AVPixelFormat pix_fmts[] = {
155 PIX_FMT_YUV410P, PIX_FMT_YUV420P,155 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P,
156 PIX_FMT_GRAY8, PIX_FMT_NV12,156 AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12,
157 PIX_FMT_NV21, PIX_FMT_YUV444P,157 AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P,
158 PIX_FMT_YUV422P, PIX_FMT_YUV411P,158 AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
159 PIX_FMT_NONE159 AV_PIX_FMT_NONE
160 };160 };
161 161
162 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));162 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_hflip.c+24−24
@@ -42,30 +42,30 @@ typedef struct { · 41 unmodified lines
42 42
43static int query_formats(AVFilterContext *ctx)43static int query_formats(AVFilterContext *ctx)
44{44{
45 static const enum PixelFormat pix_fmts[] = {45 static const enum AVPixelFormat pix_fmts[] = {
46 PIX_FMT_RGB48BE, PIX_FMT_RGB48LE,46 AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48LE,
47 PIX_FMT_BGR48BE, PIX_FMT_BGR48LE,47 AV_PIX_FMT_BGR48BE, AV_PIX_FMT_BGR48LE,
48 PIX_FMT_ARGB, PIX_FMT_RGBA,48 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
49 PIX_FMT_ABGR, PIX_FMT_BGRA,49 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
50 PIX_FMT_RGB24, PIX_FMT_BGR24,50 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
51 PIX_FMT_RGB565BE, PIX_FMT_RGB565LE,51 AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE,
52 PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,52 AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE,
53 PIX_FMT_BGR565BE, PIX_FMT_BGR565LE,53 AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE,
54 PIX_FMT_BGR555BE, PIX_FMT_BGR555LE,54 AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE,
55 PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE,55 AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE,
56 PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE,56 AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE,
57 PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE,57 AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE,
58 PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE,58 AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE,
59 PIX_FMT_YUV444P, PIX_FMT_YUV422P,59 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
60 PIX_FMT_YUV420P, PIX_FMT_YUV411P,60 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
61 PIX_FMT_YUV410P, PIX_FMT_YUV440P,61 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
62 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,62 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
63 PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P,63 AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
64 PIX_FMT_YUVA420P,64 AV_PIX_FMT_YUVA420P,
65 PIX_FMT_RGB8, PIX_FMT_BGR8,65 AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8,
66 PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE,66 AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
67 PIX_FMT_PAL8, PIX_FMT_GRAY8,67 AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
68 PIX_FMT_NONE68 AV_PIX_FMT_NONE
69 };69 };
70 70
71 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));71 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_hqdn3d.c+21−21
@@ -264,27 +264,27 @@ static void uninit(AVFilterContext *ctx) · 263 unmodified lines
264 264
265static int query_formats(AVFilterContext *ctx)265static int query_formats(AVFilterContext *ctx)
266{266{
267 static const enum PixelFormat pix_fmts[] = {267 static const enum AVPixelFormat pix_fmts[] = {
268 PIX_FMT_YUV420P,268 AV_PIX_FMT_YUV420P,
269 PIX_FMT_YUV422P,269 AV_PIX_FMT_YUV422P,
270 PIX_FMT_YUV444P,270 AV_PIX_FMT_YUV444P,
271 PIX_FMT_YUV410P,271 AV_PIX_FMT_YUV410P,
272 PIX_FMT_YUV411P,272 AV_PIX_FMT_YUV411P,
273 PIX_FMT_YUV440P,273 AV_PIX_FMT_YUV440P,
274 PIX_FMT_YUVJ420P,274 AV_PIX_FMT_YUVJ420P,
275 PIX_FMT_YUVJ422P,275 AV_PIX_FMT_YUVJ422P,
276 PIX_FMT_YUVJ444P,276 AV_PIX_FMT_YUVJ444P,
277 PIX_FMT_YUVJ440P,277 AV_PIX_FMT_YUVJ440P,
278 AV_NE( PIX_FMT_YUV420P9BE, PIX_FMT_YUV420P9LE ),278 AV_NE( AV_PIX_FMT_YUV420P9BE, AV_PIX_FMT_YUV420P9LE ),
279 AV_NE( PIX_FMT_YUV422P9BE, PIX_FMT_YUV422P9LE ),279 AV_NE( AV_PIX_FMT_YUV422P9BE, AV_PIX_FMT_YUV422P9LE ),
280 AV_NE( PIX_FMT_YUV444P9BE, PIX_FMT_YUV444P9LE ),280 AV_NE( AV_PIX_FMT_YUV444P9BE, AV_PIX_FMT_YUV444P9LE ),
281 AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ),281 AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ),
282 AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ),282 AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ),
283 AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ),283 AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ),
284 AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ),284 AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ),
285 AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ),285 AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ),
286 AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ),286 AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ),
287 PIX_FMT_NONE287 AV_PIX_FMT_NONE
288 };288 };
289 289
290 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));290 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_libopencv.c+7−7
@@ -34,14 +34,14 @@ · 33 unmodified lines
34#include "formats.h"34#include "formats.h"
35#include "video.h"35#include "video.h"
36 36
37static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum PixelFormat pixfmt)37static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum AVPixelFormat pixfmt)
38{38{
39 IplImage *tmpimg;39 IplImage *tmpimg;
40 int depth, channels_nb;40 int depth, channels_nb;
41 41
42 if (pixfmt == PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; }42 if (pixfmt == AV_PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; }
43 else if (pixfmt == PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; }43 else if (pixfmt == AV_PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; }
44 else if (pixfmt == PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; }44 else if (pixfmt == AV_PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; }
45 else return;45 else return;
46 46
47 tmpimg = cvCreateImageHeader((CvSize){picref->video->w, picref->video->h}, depth, channels_nb);47 tmpimg = cvCreateImageHeader((CvSize){picref->video->w, picref->video->h}, depth, channels_nb);
@@ -52,7 +52,7 @@ static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *pi · 4 unmodified lines
52 img->widthStep = picref->linesize[0];52 img->widthStep = picref->linesize[0];
53}53}
54 54
55static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum PixelFormat pixfmt)55static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum AVPixelFormat pixfmt)
56{56{
57 picref->linesize[0] = img->widthStep;57 picref->linesize[0] = img->widthStep;
58 picref->data[0] = img->imageData;58 picref->data[0] = img->imageData;
@@ -60,8 +60,8 @@ static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage · 1 unmodified line
60 60
61static int query_formats(AVFilterContext *ctx)61static int query_formats(AVFilterContext *ctx)
62{62{
63 static const enum PixelFormat pix_fmts[] = {63 static const enum AVPixelFormat pix_fmts[] = {
64 PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_GRAY8, PIX_FMT_NONE64 AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
65 };65 };
66 66
67 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));67 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_lut.c+25−25
@@ -144,26 +144,26 @@ static av_cold void uninit(AVFilterContext *ctx) · 143 unmodified lines
144}144}
145 145
146#define YUV_FORMATS \146#define YUV_FORMATS \
147 PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, \147 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, \
148 PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUV440P, \148 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, \
149 PIX_FMT_YUVA420P, \149 AV_PIX_FMT_YUVA420P, \
150 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, \150 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, \
151 PIX_FMT_YUVJ440P151 AV_PIX_FMT_YUVJ440P
152 152
153#define RGB_FORMATS \153#define RGB_FORMATS \
154 PIX_FMT_ARGB, PIX_FMT_RGBA, \154 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, \
155 PIX_FMT_ABGR, PIX_FMT_BGRA, \155 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, \
156 PIX_FMT_RGB24, PIX_FMT_BGR24156 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24
157 157
158static enum PixelFormat yuv_pix_fmts[] = { YUV_FORMATS, PIX_FMT_NONE };158static enum AVPixelFormat yuv_pix_fmts[] = { YUV_FORMATS, AV_PIX_FMT_NONE };
159static enum PixelFormat rgb_pix_fmts[] = { RGB_FORMATS, PIX_FMT_NONE };159static enum AVPixelFormat rgb_pix_fmts[] = { RGB_FORMATS, AV_PIX_FMT_NONE };
160static enum PixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, PIX_FMT_NONE };160static enum AVPixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, AV_PIX_FMT_NONE };
161 161
162static int query_formats(AVFilterContext *ctx)162static int query_formats(AVFilterContext *ctx)
163{163{
164 LutContext *lut = ctx->priv;164 LutContext *lut = ctx->priv;
165 165
166 enum PixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts :166 enum AVPixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts :
167 lut->is_yuv ? yuv_pix_fmts : all_pix_fmts;167 lut->is_yuv ? yuv_pix_fmts : all_pix_fmts;
168 168
169 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));169 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
@@ -223,13 +223,13 @@ static int config_props(AVFilterLink *inlink) · 53 unmodified lines
223 lut->var_values[VAR_H] = inlink->h;223 lut->var_values[VAR_H] = inlink->h;
224 224
225 switch (inlink->format) {225 switch (inlink->format) {
226 case PIX_FMT_YUV410P:226 case AV_PIX_FMT_YUV410P:
227 case PIX_FMT_YUV411P:227 case AV_PIX_FMT_YUV411P:
228 case PIX_FMT_YUV420P:228 case AV_PIX_FMT_YUV420P:
229 case PIX_FMT_YUV422P:229 case AV_PIX_FMT_YUV422P:
230 case PIX_FMT_YUV440P:230 case AV_PIX_FMT_YUV440P:
231 case PIX_FMT_YUV444P:231 case AV_PIX_FMT_YUV444P:
232 case PIX_FMT_YUVA420P:232 case AV_PIX_FMT_YUVA420P:
233 min[Y] = min[U] = min[V] = 16;233 min[Y] = min[U] = min[V] = 16;
234 max[Y] = 235;234 max[Y] = 235;
235 max[U] = max[V] = 240;235 max[U] = max[V] = 240;
@@ -246,12 +246,12 @@ static int config_props(AVFilterLink *inlink) · 10 unmodified lines
246 246
247 if (lut->is_rgb) {247 if (lut->is_rgb) {
248 switch (inlink->format) {248 switch (inlink->format) {
249 case PIX_FMT_ARGB: lut->rgba_map[A] = 0; lut->rgba_map[R] = 1; lut->rgba_map[G] = 2; lut->rgba_map[B] = 3; break;249 case AV_PIX_FMT_ARGB: lut->rgba_map[A] = 0; lut->rgba_map[R] = 1; lut->rgba_map[G] = 2; lut->rgba_map[B] = 3; break;
250 case PIX_FMT_ABGR: lut->rgba_map[A] = 0; lut->rgba_map[B] = 1; lut->rgba_map[G] = 2; lut->rgba_map[R] = 3; break;250 case AV_PIX_FMT_ABGR: lut->rgba_map[A] = 0; lut->rgba_map[B] = 1; lut->rgba_map[G] = 2; lut->rgba_map[R] = 3; break;
251 case PIX_FMT_RGBA:251 case AV_PIX_FMT_RGBA:
252 case PIX_FMT_RGB24: lut->rgba_map[R] = 0; lut->rgba_map[G] = 1; lut->rgba_map[B] = 2; lut->rgba_map[A] = 3; break;252 case AV_PIX_FMT_RGB24: lut->rgba_map[R] = 0; lut->rgba_map[G] = 1; lut->rgba_map[B] = 2; lut->rgba_map[A] = 3; break;
253 case PIX_FMT_BGRA:253 case AV_PIX_FMT_BGRA:
254 case PIX_FMT_BGR24: lut->rgba_map[B] = 0; lut->rgba_map[G] = 1; lut->rgba_map[R] = 2; lut->rgba_map[A] = 3; break;254 case AV_PIX_FMT_BGR24: lut->rgba_map[B] = 0; lut->rgba_map[G] = 1; lut->rgba_map[R] = 2; lut->rgba_map[A] = 3; break;
255 }255 }
256 lut->step = av_get_bits_per_pixel(desc) >> 3;256 lut->step = av_get_bits_per_pixel(desc) >> 3;
257 }257 }
libavfilter/vf_overlay.c+5−5
@@ -98,8 +98,8 @@ static av_cold void uninit(AVFilterContext *ctx) · 97 unmodified lines
98 98
99static int query_formats(AVFilterContext *ctx)99static int query_formats(AVFilterContext *ctx)
100{100{
101 const enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };101 const enum AVPixelFormat inout_pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
102 const enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE };102 const enum AVPixelFormat blend_pix_fmts[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
103 AVFilterFormats *inout_formats = ff_make_format_list(inout_pix_fmts);103 AVFilterFormats *inout_formats = ff_make_format_list(inout_pix_fmts);
104 AVFilterFormats *blend_formats = ff_make_format_list(blend_pix_fmts);104 AVFilterFormats *blend_formats = ff_make_format_list(blend_pix_fmts);
105 105
@@ -208,11 +208,11 @@ static void blend_frame(AVFilterContext *ctx, · 102 unmodified lines
208 start_y = FFMAX(y, 0);208 start_y = FFMAX(y, 0);
209 height = end_y - start_y;209 height = end_y - start_y;
210 210
211 if (dst->format == PIX_FMT_BGR24 || dst->format == PIX_FMT_RGB24) {211 if (dst->format == AV_PIX_FMT_BGR24 || dst->format == AV_PIX_FMT_RGB24) {
212 uint8_t *dp = dst->data[0] + x * 3 + start_y * dst->linesize[0];212 uint8_t *dp = dst->data[0] + x * 3 + start_y * dst->linesize[0];
213 uint8_t *sp = src->data[0];213 uint8_t *sp = src->data[0];
214 int b = dst->format == PIX_FMT_BGR24 ? 2 : 0;214 int b = dst->format == AV_PIX_FMT_BGR24 ? 2 : 0;
215 int r = dst->format == PIX_FMT_BGR24 ? 0 : 2;215 int r = dst->format == AV_PIX_FMT_BGR24 ? 0 : 2;
216 if (y < 0)216 if (y < 0)
217 sp += -y * src->linesize[0];217 sp += -y * src->linesize[0];
218 for (i = 0; i < height; i++) {218 for (i = 0; i < height; i++) {
libavfilter/vf_pad.c+13−13
@@ -73,19 +73,19 @@ enum var_name { · 72 unmodified lines
73 73
74static int query_formats(AVFilterContext *ctx)74static int query_formats(AVFilterContext *ctx)
75{75{
76 static const enum PixelFormat pix_fmts[] = {76 static const enum AVPixelFormat pix_fmts[] = {
77 PIX_FMT_ARGB, PIX_FMT_RGBA,77 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
78 PIX_FMT_ABGR, PIX_FMT_BGRA,78 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
79 PIX_FMT_RGB24, PIX_FMT_BGR24,79 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
80 80
81 PIX_FMT_YUV444P, PIX_FMT_YUV422P,81 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
82 PIX_FMT_YUV420P, PIX_FMT_YUV411P,82 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
83 PIX_FMT_YUV410P, PIX_FMT_YUV440P,83 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
84 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,84 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
85 PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P,85 AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
86 PIX_FMT_YUVA420P,86 AV_PIX_FMT_YUVA420P,
87 87
88 PIX_FMT_NONE88 AV_PIX_FMT_NONE
89 };89 };
90 90
91 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));91 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_scale.c+3−3
@@ -123,12 +123,12 @@ static av_cold void uninit(AVFilterContext *ctx) · 122 unmodified lines
123static int query_formats(AVFilterContext *ctx)123static int query_formats(AVFilterContext *ctx)
124{124{
125 AVFilterFormats *formats;125 AVFilterFormats *formats;
126 enum PixelFormat pix_fmt;126 enum AVPixelFormat pix_fmt;
127 int ret;127 int ret;
128 128
129 if (ctx->inputs[0]) {129 if (ctx->inputs[0]) {
130 formats = NULL;130 formats = NULL;
131 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)131 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
132 if ( sws_isSupportedInput(pix_fmt)132 if ( sws_isSupportedInput(pix_fmt)
133 && (ret = ff_add_format(&formats, pix_fmt)) < 0) {133 && (ret = ff_add_format(&formats, pix_fmt)) < 0) {
134 ff_formats_unref(&formats);134 ff_formats_unref(&formats);
@@ -138,7 +138,7 @@ static int query_formats(AVFilterContext *ctx) · 3 unmodified lines
138 }138 }
139 if (ctx->outputs[0]) {139 if (ctx->outputs[0]) {
140 formats = NULL;140 formats = NULL;
141 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)141 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
142 if ( sws_isSupportedOutput(pix_fmt)142 if ( sws_isSupportedOutput(pix_fmt)
143 && (ret = ff_add_format(&formats, pix_fmt)) < 0) {143 && (ret = ff_add_format(&formats, pix_fmt)) < 0) {
144 ff_formats_unref(&formats);144 ff_formats_unref(&formats);
libavfilter/vf_transpose.c+22−22
@@ -65,28 +65,28 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 64 unmodified lines
65 65
66static int query_formats(AVFilterContext *ctx)66static int query_formats(AVFilterContext *ctx)
67{67{
68 enum PixelFormat pix_fmts[] = {68 enum AVPixelFormat pix_fmts[] = {
69 PIX_FMT_ARGB, PIX_FMT_RGBA,69 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
70 PIX_FMT_ABGR, PIX_FMT_BGRA,70 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
71 PIX_FMT_RGB24, PIX_FMT_BGR24,71 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
72 PIX_FMT_RGB565BE, PIX_FMT_RGB565LE,72 AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE,
73 PIX_FMT_RGB555BE, PIX_FMT_RGB555LE,73 AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE,
74 PIX_FMT_BGR565BE, PIX_FMT_BGR565LE,74 AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE,
75 PIX_FMT_BGR555BE, PIX_FMT_BGR555LE,75 AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE,
76 PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE,76 AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE,
77 PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE,77 AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE,
78 PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE,78 AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE,
79 PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE,79 AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE,
80 PIX_FMT_NV12, PIX_FMT_NV21,80 AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
81 PIX_FMT_RGB8, PIX_FMT_BGR8,81 AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8,
82 PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE,82 AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
83 PIX_FMT_YUV444P, PIX_FMT_YUV422P,83 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
84 PIX_FMT_YUV420P, PIX_FMT_YUVJ420P,84 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
85 PIX_FMT_YUV411P, PIX_FMT_YUV410P,85 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
86 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,86 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
87 PIX_FMT_YUV440P, PIX_FMT_YUVJ440P,87 AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
88 PIX_FMT_YUVA420P, PIX_FMT_GRAY8,88 AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
89 PIX_FMT_NONE89 AV_PIX_FMT_NONE
90 };90 };
91 91
92 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));92 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_unsharp.c+4−4
@@ -159,10 +159,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 158 unmodified lines
159 159
160static int query_formats(AVFilterContext *ctx)160static int query_formats(AVFilterContext *ctx)
161{161{
162 enum PixelFormat pix_fmts[] = {162 enum AVPixelFormat pix_fmts[] = {
163 PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_YUV410P,163 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P,
164 PIX_FMT_YUV411P, PIX_FMT_YUV440P, PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P,164 AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
165 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE165 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
166 };166 };
167 167
168 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));168 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vf_yadif.c+21−21
@@ -357,27 +357,27 @@ static av_cold void uninit(AVFilterContext *ctx) · 356 unmodified lines
357 357
358static int query_formats(AVFilterContext *ctx)358static int query_formats(AVFilterContext *ctx)
359{359{
360 static const enum PixelFormat pix_fmts[] = {360 static const enum AVPixelFormat pix_fmts[] = {
361 PIX_FMT_YUV420P,361 AV_PIX_FMT_YUV420P,
362 PIX_FMT_YUV422P,362 AV_PIX_FMT_YUV422P,
363 PIX_FMT_YUV444P,363 AV_PIX_FMT_YUV444P,
364 PIX_FMT_YUV410P,364 AV_PIX_FMT_YUV410P,
365 PIX_FMT_YUV411P,365 AV_PIX_FMT_YUV411P,
366 PIX_FMT_GRAY8,366 AV_PIX_FMT_GRAY8,
367 PIX_FMT_YUVJ420P,367 AV_PIX_FMT_YUVJ420P,
368 PIX_FMT_YUVJ422P,368 AV_PIX_FMT_YUVJ422P,
369 PIX_FMT_YUVJ444P,369 AV_PIX_FMT_YUVJ444P,
370 AV_NE( PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE ),370 AV_NE( AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE ),
371 PIX_FMT_YUV440P,371 AV_PIX_FMT_YUV440P,
372 PIX_FMT_YUVJ440P,372 AV_PIX_FMT_YUVJ440P,
373 AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ),373 AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ),
374 AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ),374 AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ),
375 AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ),375 AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ),
376 AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ),376 AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ),
377 AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ),377 AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ),
378 AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ),378 AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ),
379 PIX_FMT_YUVA420P,379 AV_PIX_FMT_YUVA420P,
380 PIX_FMT_NONE380 AV_PIX_FMT_NONE
381 };381 };
382 382
383 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));383 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/video.c+1−1
@@ -99,7 +99,7 @@ AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link, int perms, in · 98 unmodified lines
99 99
100AVFilterBufferRef *100AVFilterBufferRef *
101avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms,101avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms,
102 int w, int h, enum PixelFormat format)102 int w, int h, enum AVPixelFormat format)
103{103{
104 AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));104 AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer));
105 AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef));105 AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef));
libavfilter/vsrc_color.c+13−13
@@ -93,19 +93,19 @@ static av_cold void color_uninit(AVFilterContext *ctx) · 92 unmodified lines
93 93
94static int query_formats(AVFilterContext *ctx)94static int query_formats(AVFilterContext *ctx)
95{95{
96 static const enum PixelFormat pix_fmts[] = {96 static const enum AVPixelFormat pix_fmts[] = {
97 PIX_FMT_ARGB, PIX_FMT_RGBA,97 AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
98 PIX_FMT_ABGR, PIX_FMT_BGRA,98 AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
99 PIX_FMT_RGB24, PIX_FMT_BGR24,99 AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
100 100
101 PIX_FMT_YUV444P, PIX_FMT_YUV422P,101 AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
102 PIX_FMT_YUV420P, PIX_FMT_YUV411P,102 AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
103 PIX_FMT_YUV410P, PIX_FMT_YUV440P,103 AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
104 PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,104 AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
105 PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P,105 AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
106 PIX_FMT_YUVA420P,106 AV_PIX_FMT_YUVA420P,
107 107
108 PIX_FMT_NONE108 AV_PIX_FMT_NONE
109 };109 };
110 110
111 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));111 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
libavfilter/vsrc_movie.c+1−1
@@ -203,7 +203,7 @@ static av_cold void uninit(AVFilterContext *ctx) · 202 unmodified lines
203static int query_formats(AVFilterContext *ctx)203static int query_formats(AVFilterContext *ctx)
204{204{
205 MovieContext *movie = ctx->priv;205 MovieContext *movie = ctx->priv;
206 enum PixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, PIX_FMT_NONE };206 enum AVPixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, AV_PIX_FMT_NONE };
207 207
208 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));208 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
209 return 0;209 return 0;
libavfilter/vsrc_testsrc.c+28−28
@@ -352,8 +352,8 @@ static av_cold int test_init(AVFilterContext *ctx, const char *args) · 351 unmodified lines
352 352
353static int test_query_formats(AVFilterContext *ctx)353static int test_query_formats(AVFilterContext *ctx)
354{354{
355 static const enum PixelFormat pix_fmts[] = {355 static const enum AVPixelFormat pix_fmts[] = {
356 PIX_FMT_RGB24, PIX_FMT_NONE356 AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
357 };357 };
358 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));358 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
359 return 0;359 return 0;
@@ -397,29 +397,29 @@ static const AVClass rgbtestsrc_class = { · 37 unmodified lines
397#define A 3397#define A 3
398 398
399static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize,399static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize,
400 int x, int y, int r, int g, int b, enum PixelFormat fmt,400 int x, int y, int r, int g, int b, enum AVPixelFormat fmt,
401 int rgba_map[4])401 int rgba_map[4])
402{402{
403 int32_t v;403 int32_t v;
404 uint8_t *p;404 uint8_t *p;
405 405
406 switch (fmt) {406 switch (fmt) {
407 case PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break;407 case AV_PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break;
408 case PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break;408 case AV_PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break;
409 case PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break;409 case AV_PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break;
410 case PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break;410 case AV_PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break;
411 case PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break;411 case AV_PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break;
412 case PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break;412 case AV_PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break;
413 case PIX_FMT_RGB24:413 case AV_PIX_FMT_RGB24:
414 case PIX_FMT_BGR24:414 case AV_PIX_FMT_BGR24:
415 v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));415 v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
416 p = dst + 3*x + y*dst_linesize;416 p = dst + 3*x + y*dst_linesize;
417 AV_WL24(p, v);417 AV_WL24(p, v);
418 break;418 break;
419 case PIX_FMT_RGBA:419 case AV_PIX_FMT_RGBA:
420 case PIX_FMT_BGRA:420 case AV_PIX_FMT_BGRA:
421 case PIX_FMT_ARGB:421 case AV_PIX_FMT_ARGB:
422 case PIX_FMT_ABGR:422 case AV_PIX_FMT_ABGR:
423 v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));423 v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
424 p = dst + 4*x + y*dst_linesize;424 p = dst + 4*x + y*dst_linesize;
425 AV_WL32(p, v);425 AV_WL32(p, v);
@@ -458,13 +458,13 @@ static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args) · 32 unmodified lines
458 458
459static int rgbtest_query_formats(AVFilterContext *ctx)459static int rgbtest_query_formats(AVFilterContext *ctx)
460{460{
461 static const enum PixelFormat pix_fmts[] = {461 static const enum AVPixelFormat pix_fmts[] = {
462 PIX_FMT_RGBA, PIX_FMT_ARGB, PIX_FMT_BGRA, PIX_FMT_ABGR,462 AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, AV_PIX_FMT_BGRA, AV_PIX_FMT_ABGR,
463 PIX_FMT_BGR24, PIX_FMT_RGB24,463 AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24,
464 PIX_FMT_RGB444, PIX_FMT_BGR444,464 AV_PIX_FMT_RGB444, AV_PIX_FMT_BGR444,
465 PIX_FMT_RGB565, PIX_FMT_BGR565,465 AV_PIX_FMT_RGB565, AV_PIX_FMT_BGR565,
466 PIX_FMT_RGB555, PIX_FMT_BGR555,466 AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555,
467 PIX_FMT_NONE467 AV_PIX_FMT_NONE
468 };468 };
469 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));469 ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
470 return 0;470 return 0;
@@ -475,12 +475,12 @@ static int rgbtest_config_props(AVFilterLink *outlink) · 4 unmodified lines
475 TestSourceContext *test = outlink->src->priv;475 TestSourceContext *test = outlink->src->priv;
476 476
477 switch (outlink->format) {477 switch (outlink->format) {
478 case PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;478 case AV_PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
479 case PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;479 case AV_PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
480 case PIX_FMT_RGBA:480 case AV_PIX_FMT_RGBA:
481 case PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;481 case AV_PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
482 case PIX_FMT_BGRA:482 case AV_PIX_FMT_BGRA:
483 case PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;483 case AV_PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
484 }484 }
485 485
486 return config_props(outlink);486 return config_props(outlink);
libavformat/bfi.c+1−1
@@ -90,7 +90,7 @@ static int bfi_read_header(AVFormatContext * s) · 89 unmodified lines
90 avpriv_set_pts_info(vstream, 32, 1, fps);90 avpriv_set_pts_info(vstream, 32, 1, fps);
91 vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO;91 vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
92 vstream->codec->codec_id = AV_CODEC_ID_BFI;92 vstream->codec->codec_id = AV_CODEC_ID_BFI;
93 vstream->codec->pix_fmt = PIX_FMT_PAL8;93 vstream->codec->pix_fmt = AV_PIX_FMT_PAL8;
94 94
95 /* Set up the audio codec now... */95 /* Set up the audio codec now... */
96 astream->codec->codec_type = AVMEDIA_TYPE_AUDIO;96 astream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
libavformat/bmv.c+1−1
@@ -50,7 +50,7 @@ static int bmv_read_header(AVFormatContext *s) · 49 unmodified lines
50 st->codec->codec_id = AV_CODEC_ID_BMV_VIDEO;50 st->codec->codec_id = AV_CODEC_ID_BMV_VIDEO;
51 st->codec->width = 640;51 st->codec->width = 640;
52 st->codec->height = 429;52 st->codec->height = 429;
53 st->codec->pix_fmt = PIX_FMT_PAL8;53 st->codec->pix_fmt = AV_PIX_FMT_PAL8;
54 avpriv_set_pts_info(st, 16, 1, 12);54 avpriv_set_pts_info(st, 16, 1, 12);
55 ast = avformat_new_stream(s, 0);55 ast = avformat_new_stream(s, 0);
56 if (!ast)56 if (!ast)
libavformat/dvenc.c+1−1
@@ -137,7 +137,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu · 136 unmodified lines
137 (1 << 3) | /* recording mode: 1 -- original */137 (1 << 3) | /* recording mode: 1 -- original */
138 7;138 7;
139 buf[3] = (1 << 7) | /* direction: 1 -- forward */139 buf[3] = (1 << 7) | /* direction: 1 -- forward */
140 (c->sys->pix_fmt == PIX_FMT_YUV420P ? 0x20 : /* speed */140 (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0x20 : /* speed */
141 c->sys->ltc_divisor * 4);141 c->sys->ltc_divisor * 4);
142 buf[4] = (1 << 7) | /* reserved -- always 1 */142 buf[4] = (1 << 7) | /* reserved -- always 1 */
143 0x7f; /* genre category */143 0x7f; /* genre category */
libavformat/filmstripdec.c+1−1
@@ -62,7 +62,7 @@ static int read_header(AVFormatContext *s) · 61 unmodified lines
62 avio_skip(pb, 2);62 avio_skip(pb, 2);
63 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;63 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
64 st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;64 st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
65 st->codec->pix_fmt = PIX_FMT_RGBA;65 st->codec->pix_fmt = AV_PIX_FMT_RGBA;
66 st->codec->codec_tag = 0; /* no fourcc */66 st->codec->codec_tag = 0; /* no fourcc */
67 st->codec->width = avio_rb16(pb);67 st->codec->width = avio_rb16(pb);
68 st->codec->height = avio_rb16(pb);68 st->codec->height = avio_rb16(pb);
libavformat/filmstripenc.c+2−2
@@ -35,8 +35,8 @@ typedef struct { · 34 unmodified lines
35 35
36static int write_header(AVFormatContext *s)36static int write_header(AVFormatContext *s)
37{37{
38 if (s->streams[0]->codec->pix_fmt != PIX_FMT_RGBA) {38 if (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_RGBA) {
39 av_log(s, AV_LOG_ERROR, "only PIX_FMT_RGBA is supported\n");39 av_log(s, AV_LOG_ERROR, "only AV_PIX_FMT_RGBA is supported\n");
40 return AVERROR_INVALIDDATA;40 return AVERROR_INVALIDDATA;
41 }41 }
42 return 0;42 return 0;
libavformat/gif.c+3−3
@@ -223,7 +223,7 @@ static int gif_image_write_image(AVIOContext *pb, · 222 unmodified lines
223 put_bits(&p, 9, 0x0100); /* clear code */223 put_bits(&p, 9, 0x0100); /* clear code */
224 224
225 for (i = (left < GIF_CHUNKS) ? left : GIF_CHUNKS; i; i--) {225 for (i = (left < GIF_CHUNKS) ? left : GIF_CHUNKS; i; i--) {
226 if (pix_fmt == PIX_FMT_RGB24) {226 if (pix_fmt == AV_PIX_FMT_RGB24) {
227 v = gif_clut_index(ptr[0], ptr[1], ptr[2]);227 v = gif_clut_index(ptr[0], ptr[1], ptr[2]);
228 ptr += 3;228 ptr += 3;
229 } else {229 } else {
@@ -290,7 +290,7 @@ static int gif_write_header(AVFormatContext *s) · 60 unmodified lines
290// rate = video_enc->time_base.den;290// rate = video_enc->time_base.den;
291 }291 }
292 292
293 if (video_enc->pix_fmt != PIX_FMT_RGB24) {293 if (video_enc->pix_fmt != AV_PIX_FMT_RGB24) {
294 av_log(s, AV_LOG_ERROR,294 av_log(s, AV_LOG_ERROR,
295 "ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.\n");295 "ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.\n");
296 return AVERROR(EIO);296 return AVERROR(EIO);
@@ -327,7 +327,7 @@ static int gif_write_video(AVFormatContext *s, AVCodecContext *enc, · 30 unmodified lines
327 avio_w8(pb, 0x00);327 avio_w8(pb, 0x00);
328 328
329 gif_image_write_image(pb, 0, 0, enc->width, enc->height,329 gif_image_write_image(pb, 0, 0, enc->width, enc->height,
330 buf, enc->width * 3, PIX_FMT_RGB24);330 buf, enc->width * 3, AV_PIX_FMT_RGB24);
331 331
332 avio_flush(s->pb);332 avio_flush(s->pb);
333 return 0;333 return 0;
libavformat/gxfenc.c+3−3
@@ -192,7 +192,7 @@ static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st) · 191 unmodified lines
192 size = snprintf(buffer, 1024, "Ver 1\nBr %.6f\nIpg 1\nPpi %d\nBpiop %d\n"192 size = snprintf(buffer, 1024, "Ver 1\nBr %.6f\nIpg 1\nPpi %d\nBpiop %d\n"
193 "Pix 0\nCf %d\nCg %d\nSl %d\nnl16 %d\nVi 1\nf1 1\n",193 "Pix 0\nCf %d\nCg %d\nSl %d\nnl16 %d\nVi 1\nf1 1\n",
194 (float)st->codec->bit_rate, sc->p_per_gop, sc->b_per_i_or_p,194 (float)st->codec->bit_rate, sc->p_per_gop, sc->b_per_i_or_p,
195 st->codec->pix_fmt == PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1,195 st->codec->pix_fmt == AV_PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1,
196 starting_line, (st->codec->height + 15) / 16);196 starting_line, (st->codec->height + 15) / 16);
197 avio_w8(pb, TRACK_MPG_AUX);197 avio_w8(pb, TRACK_MPG_AUX);
198 avio_w8(pb, size + 1);198 avio_w8(pb, size + 1);
@@ -471,7 +471,7 @@ static int gxf_write_umf_media_mpeg(AVIOContext *pb, AVStream *st) · 272 unmodified lines
471{471{
472 GXFStreamContext *sc = st->priv_data;472 GXFStreamContext *sc = st->priv_data;
473 473
474 if (st->codec->pix_fmt == PIX_FMT_YUV422P)474 if (st->codec->pix_fmt == AV_PIX_FMT_YUV422P)
475 avio_wl32(pb, 2);475 avio_wl32(pb, 2);
476 else476 else
477 avio_wl32(pb, 1); /* default to 420 */477 avio_wl32(pb, 1); /* default to 420 */
@@ -718,7 +718,7 @@ static int gxf_write_header(AVFormatContext *s) · 240 unmodified lines
718 media_info = 'M';718 media_info = 'M';
719 break;719 break;
720 case AV_CODEC_ID_DVVIDEO:720 case AV_CODEC_ID_DVVIDEO:
721 if (st->codec->pix_fmt == PIX_FMT_YUV422P) {721 if (st->codec->pix_fmt == AV_PIX_FMT_YUV422P) {
722 sc->media_type += 2;722 sc->media_type += 2;
723 sc->track_type = 6;723 sc->track_type = 6;
724 gxf->flags |= 0x00002000;724 gxf->flags |= 0x00002000;
libavformat/img2dec.c+3−3
@@ -140,7 +140,7 @@ static int read_header(AVFormatContext *s1) · 139 unmodified lines
140 int first_index, last_index, ret = 0;140 int first_index, last_index, ret = 0;
141 int width = 0, height = 0;141 int width = 0, height = 0;
142 AVStream *st;142 AVStream *st;
143 enum PixelFormat pix_fmt = PIX_FMT_NONE;143 enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
144 AVRational framerate;144 AVRational framerate;
145 145
146 s1->ctx_flags |= AVFMTCTX_NOHEADER;146 s1->ctx_flags |= AVFMTCTX_NOHEADER;
@@ -150,7 +150,7 @@ static int read_header(AVFormatContext *s1) · 3 unmodified lines
150 return AVERROR(ENOMEM);150 return AVERROR(ENOMEM);
151 }151 }
152 152
153 if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == PIX_FMT_NONE) {153 if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
154 av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", s->pixel_format);154 av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", s->pixel_format);
155 return AVERROR(EINVAL);155 return AVERROR(EINVAL);
156 }156 }
@@ -204,7 +204,7 @@ static int read_header(AVFormatContext *s1) · 47 unmodified lines
204 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;204 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
205 st->codec->codec_id = ff_guess_image2_codec(s->path);205 st->codec->codec_id = ff_guess_image2_codec(s->path);
206 }206 }
207 if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pix_fmt != PIX_FMT_NONE)207 if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pix_fmt != AV_PIX_FMT_NONE)
208 st->codec->pix_fmt = pix_fmt;208 st->codec->pix_fmt = pix_fmt;
209 209
210 return 0;210 return 0;
libavformat/lxfdec.c+1−1
@@ -39,7 +39,7 @@ static const AVCodecTag lxf_tags[] = { · 38 unmodified lines
39 { AV_CODEC_ID_DVVIDEO, 4 }, //DV2539 { AV_CODEC_ID_DVVIDEO, 4 }, //DV25
40 { AV_CODEC_ID_DVVIDEO, 5 }, //DVCPRO40 { AV_CODEC_ID_DVVIDEO, 5 }, //DVCPRO
41 { AV_CODEC_ID_DVVIDEO, 6 }, //DVCPRO5041 { AV_CODEC_ID_DVVIDEO, 6 }, //DVCPRO50
42 { AV_CODEC_ID_RAWVIDEO, 7 }, //PIX_FMT_ARGB, where alpha is used for chroma keying42 { AV_CODEC_ID_RAWVIDEO, 7 }, //AV_PIX_FMT_ARGB, where alpha is used for chroma keying
43 { AV_CODEC_ID_RAWVIDEO, 8 }, //16-bit chroma key43 { AV_CODEC_ID_RAWVIDEO, 8 }, //16-bit chroma key
44 { AV_CODEC_ID_MPEG2VIDEO, 9 }, //4:2:2 CBP ("Constrained Bytes per Gop")44 { AV_CODEC_ID_MPEG2VIDEO, 9 }, //4:2:2 CBP ("Constrained Bytes per Gop")
45 { AV_CODEC_ID_NONE, 0 },45 { AV_CODEC_ID_NONE, 0 },
libavformat/movenc.c+18−18
@@ -778,10 +778,10 @@ static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) · 777 unmodified lines
778 778
779 if (track->enc->width == 720) /* SD */779 if (track->enc->width == 720) /* SD */
780 if (track->enc->height == 480) /* NTSC */780 if (track->enc->height == 480) /* NTSC */
781 if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n');781 if (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n');
782 else tag = MKTAG('d','v','c',' ');782 else tag = MKTAG('d','v','c',' ');
783 else if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p');783 else if (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p');
784 else if (track->enc->pix_fmt == PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p');784 else if (track->enc->pix_fmt == AV_PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p');
785 else tag = MKTAG('d','v','p','p');785 else tag = MKTAG('d','v','p','p');
786 else if (track->enc->height == 720) /* HD 720 line */786 else if (track->enc->height == 720) /* HD 720 line */
787 if (track->enc->time_base.den == 50) tag = MKTAG('d','v','h','q');787 if (track->enc->time_base.den == 50) tag = MKTAG('d','v','h','q');
@@ -798,24 +798,24 @@ static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) · 10 unmodified lines
798}798}
799 799
800static const struct {800static const struct {
801 enum PixelFormat pix_fmt;801 enum AVPixelFormat pix_fmt;
802 uint32_t tag;802 uint32_t tag;
803 unsigned bps;803 unsigned bps;
804} mov_pix_fmt_tags[] = {804} mov_pix_fmt_tags[] = {
805 { PIX_FMT_YUYV422, MKTAG('y','u','v','s'), 0 },805 { AV_PIX_FMT_YUYV422, MKTAG('y','u','v','s'), 0 },
806 { PIX_FMT_UYVY422, MKTAG('2','v','u','y'), 0 },806 { AV_PIX_FMT_UYVY422, MKTAG('2','v','u','y'), 0 },
807 { PIX_FMT_RGB555BE,MKTAG('r','a','w',' '), 16 },807 { AV_PIX_FMT_RGB555BE,MKTAG('r','a','w',' '), 16 },
808 { PIX_FMT_RGB555LE,MKTAG('L','5','5','5'), 16 },808 { AV_PIX_FMT_RGB555LE,MKTAG('L','5','5','5'), 16 },
809 { PIX_FMT_RGB565LE,MKTAG('L','5','6','5'), 16 },809 { AV_PIX_FMT_RGB565LE,MKTAG('L','5','6','5'), 16 },
810 { PIX_FMT_RGB565BE,MKTAG('B','5','6','5'), 16 },810 { AV_PIX_FMT_RGB565BE,MKTAG('B','5','6','5'), 16 },
811 { PIX_FMT_GRAY16BE,MKTAG('b','1','6','g'), 16 },811 { AV_PIX_FMT_GRAY16BE,MKTAG('b','1','6','g'), 16 },
812 { PIX_FMT_RGB24, MKTAG('r','a','w',' '), 24 },812 { AV_PIX_FMT_RGB24, MKTAG('r','a','w',' '), 24 },
813 { PIX_FMT_BGR24, MKTAG('2','4','B','G'), 24 },813 { AV_PIX_FMT_BGR24, MKTAG('2','4','B','G'), 24 },
814 { PIX_FMT_ARGB, MKTAG('r','a','w',' '), 32 },814 { AV_PIX_FMT_ARGB, MKTAG('r','a','w',' '), 32 },
815 { PIX_FMT_BGRA, MKTAG('B','G','R','A'), 32 },815 { AV_PIX_FMT_BGRA, MKTAG('B','G','R','A'), 32 },
816 { PIX_FMT_RGBA, MKTAG('R','G','B','A'), 32 },816 { AV_PIX_FMT_RGBA, MKTAG('R','G','B','A'), 32 },
817 { PIX_FMT_ABGR, MKTAG('A','B','G','R'), 32 },817 { AV_PIX_FMT_ABGR, MKTAG('A','B','G','R'), 32 },
818 { PIX_FMT_RGB48BE, MKTAG('b','4','8','r'), 48 },818 { AV_PIX_FMT_RGB48BE, MKTAG('b','4','8','r'), 48 },
819};819};
820 820
821static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)821static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
libavformat/mtv.c+1−1
@@ -130,7 +130,7 @@ static int mtv_read_header(AVFormatContext *s) · 129 unmodified lines
130 avpriv_set_pts_info(st, 64, 1, mtv->video_fps);130 avpriv_set_pts_info(st, 64, 1, mtv->video_fps);
131 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;131 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
132 st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;132 st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
133 st->codec->pix_fmt = PIX_FMT_RGB565BE;133 st->codec->pix_fmt = AV_PIX_FMT_RGB565BE;
134 st->codec->width = mtv->img_width;134 st->codec->width = mtv->img_width;
135 st->codec->height = mtv->img_height;135 st->codec->height = mtv->img_height;
136 st->codec->sample_rate = mtv->video_fps;136 st->codec->sample_rate = mtv->video_fps;
libavformat/mxf.c+18−18
@@ -56,13 +56,13 @@ const MXFCodecUL ff_mxf_codec_uls[] = { · 55 unmodified lines
56};56};
57 57
58const MXFCodecUL ff_mxf_pixel_format_uls[] = {58const MXFCodecUL ff_mxf_pixel_format_uls[] = {
59 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16, PIX_FMT_UYVY422 },59 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16, AV_PIX_FMT_UYVY422 },
60 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x02 }, 16, PIX_FMT_YUYV422 },60 { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x02 }, 16, AV_PIX_FMT_YUYV422 },
61 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, PIX_FMT_NONE },61 { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_PIX_FMT_NONE },
62};62};
63 63
64static const struct {64static const struct {
65 enum PixelFormat pix_fmt;65 enum AVPixelFormat pix_fmt;
66 const char data[16];66 const char data[16];
67} ff_mxf_pixel_layouts[] = {67} ff_mxf_pixel_layouts[] = {
68 /**68 /**
@@ -74,24 +74,24 @@ static const struct { · 5 unmodified lines
74 * Note: Do not use these for encoding descriptors for little-endian formats until we74 * Note: Do not use these for encoding descriptors for little-endian formats until we
75 * get samples or official word from SMPTE on how/if those can be encoded.75 * get samples or official word from SMPTE on how/if those can be encoded.
76 */76 */
77 {PIX_FMT_ABGR, {'A', 8, 'B', 8, 'G', 8, 'R', 8 }},77 {AV_PIX_FMT_ABGR, {'A', 8, 'B', 8, 'G', 8, 'R', 8 }},
78 {PIX_FMT_ARGB, {'A', 8, 'R', 8, 'G', 8, 'B', 8 }},78 {AV_PIX_FMT_ARGB, {'A', 8, 'R', 8, 'G', 8, 'B', 8 }},
79 {PIX_FMT_BGR24, {'B', 8, 'G', 8, 'R', 8 }},79 {AV_PIX_FMT_BGR24, {'B', 8, 'G', 8, 'R', 8 }},
80 {PIX_FMT_BGRA, {'B', 8, 'G', 8, 'R', 8, 'A', 8 }},80 {AV_PIX_FMT_BGRA, {'B', 8, 'G', 8, 'R', 8, 'A', 8 }},
81 {PIX_FMT_RGB24, {'R', 8, 'G', 8, 'B', 8 }},81 {AV_PIX_FMT_RGB24, {'R', 8, 'G', 8, 'B', 8 }},
82 {PIX_FMT_RGB444BE,{'F', 4, 'R', 4, 'G', 4, 'B', 4 }},82 {AV_PIX_FMT_RGB444BE,{'F', 4, 'R', 4, 'G', 4, 'B', 4 }},
83 {PIX_FMT_RGB48BE, {'R', 8, 'r', 8, 'G', 8, 'g', 8, 'B', 8, 'b', 8 }},83 {AV_PIX_FMT_RGB48BE, {'R', 8, 'r', 8, 'G', 8, 'g', 8, 'B', 8, 'b', 8 }},
84 {PIX_FMT_RGB48BE, {'R', 16, 'G', 16, 'B', 16 }},84 {AV_PIX_FMT_RGB48BE, {'R', 16, 'G', 16, 'B', 16 }},
85 {PIX_FMT_RGB48LE, {'r', 8, 'R', 8, 'g', 8, 'G', 8, 'b', 8, 'B', 8 }},85 {AV_PIX_FMT_RGB48LE, {'r', 8, 'R', 8, 'g', 8, 'G', 8, 'b', 8, 'B', 8 }},
86 {PIX_FMT_RGB555BE,{'F', 1, 'R', 5, 'G', 5, 'B', 5 }},86 {AV_PIX_FMT_RGB555BE,{'F', 1, 'R', 5, 'G', 5, 'B', 5 }},
87 {PIX_FMT_RGB565BE,{'R', 5, 'G', 6, 'B', 5 }},87 {AV_PIX_FMT_RGB565BE,{'R', 5, 'G', 6, 'B', 5 }},
88 {PIX_FMT_RGBA, {'R', 8, 'G', 8, 'B', 8, 'A', 8 }},88 {AV_PIX_FMT_RGBA, {'R', 8, 'G', 8, 'B', 8, 'A', 8 }},
89 {PIX_FMT_PAL8, {'P', 8 }},89 {AV_PIX_FMT_PAL8, {'P', 8 }},
90};90};
91 91
92static const int num_pixel_layouts = FF_ARRAY_ELEMS(ff_mxf_pixel_layouts);92static const int num_pixel_layouts = FF_ARRAY_ELEMS(ff_mxf_pixel_layouts);
93 93
94int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt)94int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt)
95{95{
96 int x;96 int x;
97 97
libavformat/mxf.h+1−1
@@ -70,7 +70,7 @@ extern const MXFCodecUL ff_mxf_data_definition_uls[]; · 69 unmodified lines
70extern const MXFCodecUL ff_mxf_codec_uls[];70extern const MXFCodecUL ff_mxf_codec_uls[];
71extern const MXFCodecUL ff_mxf_pixel_format_uls[];71extern const MXFCodecUL ff_mxf_pixel_format_uls[];
72 72
73int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt);73int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt);
74 74
75#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \75#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
76 (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])76 (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
libavformat/mxfdec.c+5−5
@@ -144,7 +144,7 @@ typedef struct { · 143 unmodified lines
144 int linked_track_id;144 int linked_track_id;
145 uint8_t *extradata;145 uint8_t *extradata;
146 int extradata_size;146 int extradata_size;
147 enum PixelFormat pix_fmt;147 enum AVPixelFormat pix_fmt;
148} MXFDescriptor;148} MXFDescriptor;
149 149
150typedef struct {150typedef struct {
@@ -798,7 +798,7 @@ static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor) · 647 unmodified lines
798static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)798static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
799{799{
800 MXFDescriptor *descriptor = arg;800 MXFDescriptor *descriptor = arg;
801 descriptor->pix_fmt = PIX_FMT_NONE;801 descriptor->pix_fmt = AV_PIX_FMT_NONE;
802 switch(tag) {802 switch(tag) {
803 case 0x3F01:803 case 0x3F01:
804 descriptor->sub_descriptors_count = avio_rb32(pb);804 descriptor->sub_descriptors_count = avio_rb32(pb);
@@ -1501,17 +1501,17 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) · 696 unmodified lines
1501 }1501 }
1502 if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) {1502 if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) {
1503 st->codec->pix_fmt = descriptor->pix_fmt;1503 st->codec->pix_fmt = descriptor->pix_fmt;
1504 if (st->codec->pix_fmt == PIX_FMT_NONE) {1504 if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
1505 pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls,1505 pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls,
1506 &descriptor->essence_codec_ul);1506 &descriptor->essence_codec_ul);
1507 st->codec->pix_fmt = pix_fmt_ul->id;1507 st->codec->pix_fmt = pix_fmt_ul->id;
1508 if (st->codec->pix_fmt == PIX_FMT_NONE) {1508 if (st->codec->pix_fmt == AV_PIX_FMT_NONE) {
1509 /* support files created before RP224v10 by defaulting to UYVY4221509 /* support files created before RP224v10 by defaulting to UYVY422
1510 if subsampling is 4:2:2 and component depth is 8-bit */1510 if subsampling is 4:2:2 and component depth is 8-bit */
1511 if (descriptor->horiz_subsampling == 2 &&1511 if (descriptor->horiz_subsampling == 2 &&
1512 descriptor->vert_subsampling == 1 &&1512 descriptor->vert_subsampling == 1 &&
1513 descriptor->component_depth == 8) {1513 descriptor->component_depth == 8) {
1514 st->codec->pix_fmt = PIX_FMT_UYVY422;1514 st->codec->pix_fmt = AV_PIX_FMT_UYVY422;
1515 }1515 }
1516 }1516 }
1517 }1517 }
libavformat/output-example.c+6−6
@@ -44,7 +44,7 @@ · 43 unmodified lines
44#define STREAM_DURATION 5.044#define STREAM_DURATION 5.0
45#define STREAM_FRAME_RATE 25 /* 25 images/s */45#define STREAM_FRAME_RATE 25 /* 25 images/s */
46#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))46#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
47#define STREAM_PIX_FMT PIX_FMT_YUV420P /* default pix_fmt */47#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */
48 48
49static int sws_flags = SWS_BICUBIC;49static int sws_flags = SWS_BICUBIC;
50 50
@@ -234,7 +234,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum AVCodecID codec_id) · 183 unmodified lines
234 return st;234 return st;
235}235}
236 236
237static AVFrame *alloc_picture(enum PixelFormat pix_fmt, int width, int height)237static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
238{238{
239 AVFrame *picture;239 AVFrame *picture;
240 uint8_t *picture_buf;240 uint8_t *picture_buf;
@@ -289,8 +289,8 @@ static void open_video(AVFormatContext *oc, AVStream *st) · 48 unmodified lines
289 * picture is needed too. It is then converted to the required289 * picture is needed too. It is then converted to the required
290 * output format. */290 * output format. */
291 tmp_picture = NULL;291 tmp_picture = NULL;
292 if (c->pix_fmt != PIX_FMT_YUV420P) {292 if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
293 tmp_picture = alloc_picture(PIX_FMT_YUV420P, c->width, c->height);293 tmp_picture = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height);
294 if (!tmp_picture) {294 if (!tmp_picture) {
295 fprintf(stderr, "Could not allocate temporary picture\n");295 fprintf(stderr, "Could not allocate temporary picture\n");
296 exit(1);296 exit(1);
@@ -333,12 +333,12 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st) · 36 unmodified lines
333 * frames if using B-frames, so we get the last frames by333 * frames if using B-frames, so we get the last frames by
334 * passing the same picture again. */334 * passing the same picture again. */
335 } else {335 } else {
336 if (c->pix_fmt != PIX_FMT_YUV420P) {336 if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
337 /* as we only generate a YUV420P picture, we must convert it337 /* as we only generate a YUV420P picture, we must convert it
338 * to the codec pixel format if needed */338 * to the codec pixel format if needed */
339 if (img_convert_ctx == NULL) {339 if (img_convert_ctx == NULL) {
340 img_convert_ctx = sws_getContext(c->width, c->height,340 img_convert_ctx = sws_getContext(c->width, c->height,
341 PIX_FMT_YUV420P,341 AV_PIX_FMT_YUV420P,
342 c->width, c->height,342 c->width, c->height,
343 c->pix_fmt,343 c->pix_fmt,
344 sws_flags, NULL, NULL, NULL);344 sws_flags, NULL, NULL, NULL);
libavformat/rawdec.c+2−2
@@ -69,14 +69,14 @@ int ff_raw_read_header(AVFormatContext *s) · 68 unmodified lines
69 case AVMEDIA_TYPE_VIDEO: {69 case AVMEDIA_TYPE_VIDEO: {
70 FFRawVideoDemuxerContext *s1 = s->priv_data;70 FFRawVideoDemuxerContext *s1 = s->priv_data;
71 int width = 0, height = 0, ret = 0;71 int width = 0, height = 0, ret = 0;
72 enum PixelFormat pix_fmt;72 enum AVPixelFormat pix_fmt;
73 AVRational framerate;73 AVRational framerate;
74 74
75 if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) {75 if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) {
76 av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");76 av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n");
77 goto fail;77 goto fail;
78 }78 }
79 if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == PIX_FMT_NONE) {79 if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == AV_PIX_FMT_NONE) {
80 av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format);80 av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format);
81 ret = AVERROR(EINVAL);81 ret = AVERROR(EINVAL);
82 goto fail;82 goto fail;
libavformat/rtpdec_xiph.c+3−3
@@ -313,11 +313,11 @@ static int xiph_parse_fmtp_pair(AVStream* stream, · 312 unmodified lines
313 313
314 if (!strcmp(attr, "sampling")) {314 if (!strcmp(attr, "sampling")) {
315 if (!strcmp(value, "YCbCr-4:2:0")) {315 if (!strcmp(value, "YCbCr-4:2:0")) {
316 codec->pix_fmt = PIX_FMT_YUV420P;316 codec->pix_fmt = AV_PIX_FMT_YUV420P;
317 } else if (!strcmp(value, "YCbCr-4:4:2")) {317 } else if (!strcmp(value, "YCbCr-4:4:2")) {
318 codec->pix_fmt = PIX_FMT_YUV422P;318 codec->pix_fmt = AV_PIX_FMT_YUV422P;
319 } else if (!strcmp(value, "YCbCr-4:4:4")) {319 } else if (!strcmp(value, "YCbCr-4:4:4")) {
320 codec->pix_fmt = PIX_FMT_YUV444P;320 codec->pix_fmt = AV_PIX_FMT_YUV444P;
321 } else {321 } else {
322 av_log(codec, AV_LOG_ERROR,322 av_log(codec, AV_LOG_ERROR,
323 "Unsupported pixel format %s\n", attr);323 "Unsupported pixel format %s\n", attr);
libavformat/rtpenc_jpeg.c+3−3
@@ -29,7 +29,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) · 28 unmodified lines
29 RTPMuxContext *s = s1->priv_data;29 RTPMuxContext *s = s1->priv_data;
30 const uint8_t *qtables = NULL;30 const uint8_t *qtables = NULL;
31 int nb_qtables = 0;31 int nb_qtables = 0;
32 uint8_t type = 1; /* default pixel format is PIX_FMT_YUVJ420P */32 uint8_t type = 1; /* default pixel format is AV_PIX_FMT_YUVJ420P */
33 uint8_t w, h;33 uint8_t w, h;
34 uint8_t *p;34 uint8_t *p;
35 int off = 0; /* fragment offset of the current JPEG frame */35 int off = 0; /* fragment offset of the current JPEG frame */
@@ -44,9 +44,9 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) · 8 unmodified lines
44 h = s1->streams[0]->codec->height >> 3;44 h = s1->streams[0]->codec->height >> 3;
45 45
46 /* check if pixel format is not the normal 420 case */46 /* check if pixel format is not the normal 420 case */
47 if (s1->streams[0]->codec->pix_fmt == PIX_FMT_YUVJ422P) {47 if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P) {
48 type = 0;48 type = 0;
49 } else if (s1->streams[0]->codec->pix_fmt == PIX_FMT_YUVJ420P) {49 } else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P) {
50 type = 1;50 type = 1;
51 } else {51 } else {
52 av_log(s1, AV_LOG_ERROR, "Unsupported pixel format\n");52 av_log(s1, AV_LOG_ERROR, "Unsupported pixel format\n");
libavformat/sdp.c+3−3
@@ -521,13 +521,13 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, · 520 unmodified lines
521 return NULL;521 return NULL;
522 522
523 switch (c->pix_fmt) {523 switch (c->pix_fmt) {
524 case PIX_FMT_YUV420P:524 case AV_PIX_FMT_YUV420P:
525 pix_fmt = "YCbCr-4:2:0";525 pix_fmt = "YCbCr-4:2:0";
526 break;526 break;
527 case PIX_FMT_YUV422P:527 case AV_PIX_FMT_YUV422P:
528 pix_fmt = "YCbCr-4:2:2";528 pix_fmt = "YCbCr-4:2:2";
529 break;529 break;
530 case PIX_FMT_YUV444P:530 case AV_PIX_FMT_YUV444P:
531 pix_fmt = "YCbCr-4:4:4";531 pix_fmt = "YCbCr-4:4:4";
532 break;532 break;
533 default:533 default:
libavformat/segafilm.c+1−1
@@ -150,7 +150,7 @@ static int film_read_header(AVFormatContext *s) · 149 unmodified lines
150 150
151 if (film->video_type == AV_CODEC_ID_RAWVIDEO) {151 if (film->video_type == AV_CODEC_ID_RAWVIDEO) {
152 if (scratch[20] == 24) {152 if (scratch[20] == 24) {
153 st->codec->pix_fmt = PIX_FMT_RGB24;153 st->codec->pix_fmt = AV_PIX_FMT_RGB24;
154 } else {154 } else {
155 av_log(s, AV_LOG_ERROR, "raw video is using unhandled %dbpp\n", scratch[20]);155 av_log(s, AV_LOG_ERROR, "raw video is using unhandled %dbpp\n", scratch[20]);
156 return -1;156 return -1;
libavformat/siff.c+1−1
@@ -124,7 +124,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb) · 123 unmodified lines
124 st->codec->codec_tag = MKTAG('V', 'B', 'V', '1');124 st->codec->codec_tag = MKTAG('V', 'B', 'V', '1');
125 st->codec->width = width;125 st->codec->width = width;
126 st->codec->height = height;126 st->codec->height = height;
127 st->codec->pix_fmt = PIX_FMT_PAL8;127 st->codec->pix_fmt = AV_PIX_FMT_PAL8;
128 avpriv_set_pts_info(st, 16, 1, 12);128 avpriv_set_pts_info(st, 16, 1, 12);
129 129
130 c->cur_frame = 0;130 c->cur_frame = 0;
libavformat/smacker.c+1−1
@@ -161,7 +161,7 @@ static int smacker_read_header(AVFormatContext *s) · 160 unmodified lines
161 smk->videoindex = st->index;161 smk->videoindex = st->index;
162 st->codec->width = smk->width;162 st->codec->width = smk->width;
163 st->codec->height = smk->height;163 st->codec->height = smk->height;
164 st->codec->pix_fmt = PIX_FMT_PAL8;164 st->codec->pix_fmt = AV_PIX_FMT_PAL8;
165 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;165 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
166 st->codec->codec_id = AV_CODEC_ID_SMACKVIDEO;166 st->codec->codec_id = AV_CODEC_ID_SMACKVIDEO;
167 st->codec->codec_tag = smk->magic;167 st->codec->codec_tag = smk->magic;
libavformat/tmv.c+1−1
@@ -124,7 +124,7 @@ static int tmv_read_header(AVFormatContext *s) · 123 unmodified lines
124 124
125 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;125 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
126 vst->codec->codec_id = AV_CODEC_ID_TMV;126 vst->codec->codec_id = AV_CODEC_ID_TMV;
127 vst->codec->pix_fmt = PIX_FMT_PAL8;127 vst->codec->pix_fmt = AV_PIX_FMT_PAL8;
128 vst->codec->width = char_cols * 8;128 vst->codec->width = char_cols * 8;
129 vst->codec->height = char_rows * 8;129 vst->codec->height = char_rows * 8;
130 avpriv_set_pts_info(vst, 32, fps.den, fps.num);130 avpriv_set_pts_info(vst, 32, fps.den, fps.num);
libavformat/utils.c+1−1
@@ -2018,7 +2018,7 @@ static int has_codec_parameters(AVStream *st) · 2017 unmodified lines
2018 break;2018 break;
2019 case AVMEDIA_TYPE_VIDEO:2019 case AVMEDIA_TYPE_VIDEO:
2020 val = avctx->width;2020 val = avctx->width;
2021 if (st->info->found_decoder >= 0 && avctx->pix_fmt == PIX_FMT_NONE)2021 if (st->info->found_decoder >= 0 && avctx->pix_fmt == AV_PIX_FMT_NONE)
2022 return 0;2022 return 0;
2023 break;2023 break;
2024 default:2024 default:
libavformat/yuv4mpeg.c+29−29
@@ -57,23 +57,23 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf) · 56 unmodified lines
57 inter = st->codec->coded_frame->top_field_first ? 't' : 'b';57 inter = st->codec->coded_frame->top_field_first ? 't' : 'b';
58 58
59 switch (st->codec->pix_fmt) {59 switch (st->codec->pix_fmt) {
60 case PIX_FMT_GRAY8:60 case AV_PIX_FMT_GRAY8:
61 colorspace = " Cmono";61 colorspace = " Cmono";
62 break;62 break;
63 case PIX_FMT_YUV411P:63 case AV_PIX_FMT_YUV411P:
64 colorspace = " C411 XYSCSS=411";64 colorspace = " C411 XYSCSS=411";
65 break;65 break;
66 case PIX_FMT_YUV420P:66 case AV_PIX_FMT_YUV420P:
67 switch (st->codec->chroma_sample_location) {67 switch (st->codec->chroma_sample_location) {
68 case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break;68 case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break;
69 case AVCHROMA_LOC_LEFT: colorspace = " C420mpeg2 XYSCSS=420MPEG2"; break;69 case AVCHROMA_LOC_LEFT: colorspace = " C420mpeg2 XYSCSS=420MPEG2"; break;
70 default: colorspace = " C420jpeg XYSCSS=420JPEG"; break;70 default: colorspace = " C420jpeg XYSCSS=420JPEG"; break;
71 }71 }
72 break;72 break;
73 case PIX_FMT_YUV422P:73 case AV_PIX_FMT_YUV422P:
74 colorspace = " C422 XYSCSS=422";74 colorspace = " C422 XYSCSS=422";
75 break;75 break;
76 case PIX_FMT_YUV444P:76 case AV_PIX_FMT_YUV444P:
77 colorspace = " C444 XYSCSS=444";77 colorspace = " C444 XYSCSS=444";
78 break;78 break;
79 }79 }
@@ -126,7 +126,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) · 46 unmodified lines
126 ptr += picture->linesize[0];126 ptr += picture->linesize[0];
127 }127 }
128 128
129 if (st->codec->pix_fmt != PIX_FMT_GRAY8) {129 if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8) {
130 // Adjust for smaller Cb and Cr planes130 // Adjust for smaller Cb and Cr planes
131 avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,131 avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
132 &v_chroma_shift);132 &v_chroma_shift);
@@ -155,13 +155,13 @@ static int yuv4_write_header(AVFormatContext *s) · 22 unmodified lines
155 if (s->nb_streams != 1)155 if (s->nb_streams != 1)
156 return AVERROR(EIO);156 return AVERROR(EIO);
157 157
158 if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {158 if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
159 av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "159 av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
160 "stream, some mjpegtools might not work.\n");160 "stream, some mjpegtools might not work.\n");
161 } else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&161 } else if ((s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV420P) &&
162 (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&162 (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV422P) &&
163 (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&163 (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_GRAY8) &&
164 (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {164 (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV444P)) {
165 av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, "165 av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, "
166 "yuv422p, yuv420p, yuv411p and gray pixel formats. "166 "yuv422p, yuv420p, yuv411p and gray pixel formats. "
167 "Use -pix_fmt to select one.\n");167 "Use -pix_fmt to select one.\n");
@@ -199,7 +199,7 @@ static int yuv4_read_header(AVFormatContext *s) · 31 unmodified lines
199 AVIOContext *pb = s->pb;199 AVIOContext *pb = s->pb;
200 int width = -1, height = -1, raten = 0,200 int width = -1, height = -1, raten = 0,
201 rated = 0, aspectn = 0, aspectd = 0;201 rated = 0, aspectn = 0, aspectd = 0;
202 enum PixelFormat pix_fmt = PIX_FMT_NONE, alt_pix_fmt = PIX_FMT_NONE;202 enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = AV_PIX_FMT_NONE;
203 enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;203 enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
204 AVStream *st;204 AVStream *st;
205 struct frame_attributes *s1 = s->priv_data;205 struct frame_attributes *s1 = s->priv_data;
@@ -236,29 +236,29 @@ static int yuv4_read_header(AVFormatContext *s) · 30 unmodified lines
236 break;236 break;
237 case 'C': // Color space237 case 'C': // Color space
238 if (strncmp("420jpeg", tokstart, 7) == 0) {238 if (strncmp("420jpeg", tokstart, 7) == 0) {
239 pix_fmt = PIX_FMT_YUV420P;239 pix_fmt = AV_PIX_FMT_YUV420P;
240 chroma_sample_location = AVCHROMA_LOC_CENTER;240 chroma_sample_location = AVCHROMA_LOC_CENTER;
241 } else if (strncmp("420mpeg2", tokstart, 8) == 0) {241 } else if (strncmp("420mpeg2", tokstart, 8) == 0) {
242 pix_fmt = PIX_FMT_YUV420P;242 pix_fmt = AV_PIX_FMT_YUV420P;
243 chroma_sample_location = AVCHROMA_LOC_LEFT;243 chroma_sample_location = AVCHROMA_LOC_LEFT;
244 } else if (strncmp("420paldv", tokstart, 8) == 0) {244 } else if (strncmp("420paldv", tokstart, 8) == 0) {
245 pix_fmt = PIX_FMT_YUV420P;245 pix_fmt = AV_PIX_FMT_YUV420P;
246 chroma_sample_location = AVCHROMA_LOC_TOPLEFT;246 chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
247 } else if (strncmp("420", tokstart, 3) == 0) {247 } else if (strncmp("420", tokstart, 3) == 0) {
248 pix_fmt = PIX_FMT_YUV420P;248 pix_fmt = AV_PIX_FMT_YUV420P;
249 chroma_sample_location = AVCHROMA_LOC_CENTER;249 chroma_sample_location = AVCHROMA_LOC_CENTER;
250 } else if (strncmp("411", tokstart, 3) == 0)250 } else if (strncmp("411", tokstart, 3) == 0)
251 pix_fmt = PIX_FMT_YUV411P;251 pix_fmt = AV_PIX_FMT_YUV411P;
252 else if (strncmp("422", tokstart, 3) == 0)252 else if (strncmp("422", tokstart, 3) == 0)
253 pix_fmt = PIX_FMT_YUV422P;253 pix_fmt = AV_PIX_FMT_YUV422P;
254 else if (strncmp("444alpha", tokstart, 8) == 0 ) {254 else if (strncmp("444alpha", tokstart, 8) == 0 ) {
255 av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 "255 av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 "
256 "YUV4MPEG stream.\n");256 "YUV4MPEG stream.\n");
257 return -1;257 return -1;
258 } else if (strncmp("444", tokstart, 3) == 0)258 } else if (strncmp("444", tokstart, 3) == 0)
259 pix_fmt = PIX_FMT_YUV444P;259 pix_fmt = AV_PIX_FMT_YUV444P;
260 else if (strncmp("mono", tokstart, 4) == 0) {260 else if (strncmp("mono", tokstart, 4) == 0) {
261 pix_fmt = PIX_FMT_GRAY8;261 pix_fmt = AV_PIX_FMT_GRAY8;
262 } else {262 } else {
263 av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown "263 av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown "
264 "pixel format.\n");264 "pixel format.\n");
@@ -306,17 +306,17 @@ static int yuv4_read_header(AVFormatContext *s) · 41 unmodified lines
306 // Older nonstandard pixel format representation306 // Older nonstandard pixel format representation
307 tokstart += 6;307 tokstart += 6;
308 if (strncmp("420JPEG", tokstart, 7) == 0)308 if (strncmp("420JPEG", tokstart, 7) == 0)
309 alt_pix_fmt = PIX_FMT_YUV420P;309 alt_pix_fmt = AV_PIX_FMT_YUV420P;
310 else if (strncmp("420MPEG2", tokstart, 8) == 0)310 else if (strncmp("420MPEG2", tokstart, 8) == 0)
311 alt_pix_fmt = PIX_FMT_YUV420P;311 alt_pix_fmt = AV_PIX_FMT_YUV420P;
312 else if (strncmp("420PALDV", tokstart, 8) == 0)312 else if (strncmp("420PALDV", tokstart, 8) == 0)
313 alt_pix_fmt = PIX_FMT_YUV420P;313 alt_pix_fmt = AV_PIX_FMT_YUV420P;
314 else if (strncmp("411", tokstart, 3) == 0)314 else if (strncmp("411", tokstart, 3) == 0)
315 alt_pix_fmt = PIX_FMT_YUV411P;315 alt_pix_fmt = AV_PIX_FMT_YUV411P;
316 else if (strncmp("422", tokstart, 3) == 0)316 else if (strncmp("422", tokstart, 3) == 0)
317 alt_pix_fmt = PIX_FMT_YUV422P;317 alt_pix_fmt = AV_PIX_FMT_YUV422P;
318 else if (strncmp("444", tokstart, 3) == 0)318 else if (strncmp("444", tokstart, 3) == 0)
319 alt_pix_fmt = PIX_FMT_YUV444P;319 alt_pix_fmt = AV_PIX_FMT_YUV444P;
320 }320 }
321 while (tokstart < header_end && *tokstart != 0x20)321 while (tokstart < header_end && *tokstart != 0x20)
322 tokstart++;322 tokstart++;
@@ -329,9 +329,9 @@ static int yuv4_read_header(AVFormatContext *s) · 6 unmodified lines
329 return -1;329 return -1;
330 }330 }
331 331
332 if (pix_fmt == PIX_FMT_NONE) {332 if (pix_fmt == AV_PIX_FMT_NONE) {
333 if (alt_pix_fmt == PIX_FMT_NONE)333 if (alt_pix_fmt == AV_PIX_FMT_NONE)
334 pix_fmt = PIX_FMT_YUV420P;334 pix_fmt = AV_PIX_FMT_YUV420P;
335 else335 else
336 pix_fmt = alt_pix_fmt;336 pix_fmt = alt_pix_fmt;
337 }337 }
libavutil/imgutils.c+13−13
@@ -45,7 +45,7 @@ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], · 44 unmodified lines
45 }45 }
46}46}
47 47
48int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane)48int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane)
49{49{
50 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];50 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
51 int max_step [4]; /* max pixel step for each plane */51 int max_step [4]; /* max pixel step for each plane */
@@ -60,7 +60,7 @@ int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane) · 8 unmodified lines
60 return max_step[plane] * (((width + (1 << s) - 1)) >> s);60 return max_step[plane] * (((width + (1 << s) - 1)) >> s);
61}61}
62 62
63int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width)63int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width)
64{64{
65 int i;65 int i;
66 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];66 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
@@ -69,7 +69,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt · 2 unmodified lines
69 69
70 memset(linesizes, 0, 4*sizeof(linesizes[0]));70 memset(linesizes, 0, 4*sizeof(linesizes[0]));
71 71
72 if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL)72 if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL)
73 return AVERROR(EINVAL);73 return AVERROR(EINVAL);
74 74
75 if (desc->flags & PIX_FMT_BITSTREAM) {75 if (desc->flags & PIX_FMT_BITSTREAM) {
@@ -91,7 +91,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt · 15 unmodified lines
91 return 0;91 return 0;
92}92}
93 93
94int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,94int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
95 uint8_t *ptr, const int linesizes[4])95 uint8_t *ptr, const int linesizes[4])
96{96{
97 int i, total_size, size[4] = { 0 }, has_plane[4] = { 0 };97 int i, total_size, size[4] = { 0 }, has_plane[4] = { 0 };
@@ -99,7 +99,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh · 1 unmodified line
99 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];99 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
100 memset(data , 0, sizeof(data[0])*4);100 memset(data , 0, sizeof(data[0])*4);
101 101
102 if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL)102 if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL)
103 return AVERROR(EINVAL);103 return AVERROR(EINVAL);
104 104
105 data[0] = ptr;105 data[0] = ptr;
@@ -133,7 +133,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh · 27 unmodified lines
133 return total_size;133 return total_size;
134}134}
135 135
136int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt)136int ff_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt)
137{137{
138 int i;138 int i;
139 139
@@ -141,27 +141,27 @@ int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt) · 1 unmodified line
141 int r, g, b;141 int r, g, b;
142 142
143 switch (pix_fmt) {143 switch (pix_fmt) {
144 case PIX_FMT_RGB8:144 case AV_PIX_FMT_RGB8:
145 r = (i>>5 )*36;145 r = (i>>5 )*36;
146 g = ((i>>2)&7)*36;146 g = ((i>>2)&7)*36;
147 b = (i&3 )*85;147 b = (i&3 )*85;
148 break;148 break;
149 case PIX_FMT_BGR8:149 case AV_PIX_FMT_BGR8:
150 b = (i>>6 )*85;150 b = (i>>6 )*85;
151 g = ((i>>3)&7)*36;151 g = ((i>>3)&7)*36;
152 r = (i&7 )*36;152 r = (i&7 )*36;
153 break;153 break;
154 case PIX_FMT_RGB4_BYTE:154 case AV_PIX_FMT_RGB4_BYTE:
155 r = (i>>3 )*255;155 r = (i>>3 )*255;
156 g = ((i>>1)&3)*85;156 g = ((i>>1)&3)*85;
157 b = (i&1 )*255;157 b = (i&1 )*255;
158 break;158 break;
159 case PIX_FMT_BGR4_BYTE:159 case AV_PIX_FMT_BGR4_BYTE:
160 b = (i>>3 )*255;160 b = (i>>3 )*255;
161 g = ((i>>1)&3)*85;161 g = ((i>>1)&3)*85;
162 r = (i&1 )*255;162 r = (i&1 )*255;
163 break;163 break;
164 case PIX_FMT_GRAY8:164 case AV_PIX_FMT_GRAY8:
165 r = b = g = i;165 r = b = g = i;
166 break;166 break;
167 default:167 default:
@@ -174,7 +174,7 @@ int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt) · 6 unmodified lines
174}174}
175 175
176int av_image_alloc(uint8_t *pointers[4], int linesizes[4],176int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
177 int w, int h, enum PixelFormat pix_fmt, int align)177 int w, int h, enum AVPixelFormat pix_fmt, int align)
178{178{
179 int i, ret;179 int i, ret;
180 uint8_t *buf;180 uint8_t *buf;
@@ -237,7 +237,7 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, · 56 unmodified lines
237 237
238void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],238void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
239 const uint8_t *src_data[4], const int src_linesizes[4],239 const uint8_t *src_data[4], const int src_linesizes[4],
240 enum PixelFormat pix_fmt, int width, int height)240 enum AVPixelFormat pix_fmt, int width, int height)
241{241{
242 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];242 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
243 243
libavutil/imgutils.h+6−6
@@ -55,7 +55,7 @@ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], · 54 unmodified lines
55 *55 *
56 * @return the computed size in bytes56 * @return the computed size in bytes
57 */57 */
58int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane);58int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
59 59
60/**60/**
61 * Fill plane linesizes for an image with pixel format pix_fmt and61 * Fill plane linesizes for an image with pixel format pix_fmt and
@@ -64,7 +64,7 @@ int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane); · 2 unmodified lines
64 * @param linesizes array to be filled with the linesize for each plane64 * @param linesizes array to be filled with the linesize for each plane
65 * @return >= 0 in case of success, a negative error code otherwise65 * @return >= 0 in case of success, a negative error code otherwise
66 */66 */
67int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width);67int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
68 68
69/**69/**
70 * Fill plane data pointers for an image with pixel format pix_fmt and70 * Fill plane data pointers for an image with pixel format pix_fmt and
@@ -77,7 +77,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt · 6 unmodified lines
77 * @return the size in bytes required for the image buffer, a negative77 * @return the size in bytes required for the image buffer, a negative
78 * error code in case of failure78 * error code in case of failure
79 */79 */
80int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,80int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
81 uint8_t *ptr, const int linesizes[4]);81 uint8_t *ptr, const int linesizes[4]);
82 82
83/**83/**
@@ -91,7 +91,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh · 7 unmodified lines
91 * error code in case of failure91 * error code in case of failure
92 */92 */
93int av_image_alloc(uint8_t *pointers[4], int linesizes[4],93int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
94 int w, int h, enum PixelFormat pix_fmt, int align);94 int w, int h, enum AVPixelFormat pix_fmt, int align);
95 95
96/**96/**
97 * Copy image plane from src to dst.97 * Copy image plane from src to dst.
@@ -114,7 +114,7 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, · 16 unmodified lines
114 */114 */
115void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],115void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
116 const uint8_t *src_data[4], const int src_linesizes[4],116 const uint8_t *src_data[4], const int src_linesizes[4],
117 enum PixelFormat pix_fmt, int width, int height);117 enum AVPixelFormat pix_fmt, int width, int height);
118 118
119/**119/**
120 * Check if the given dimension of an image is valid, meaning that all120 * Check if the given dimension of an image is valid, meaning that all
@@ -128,7 +128,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], · 7 unmodified lines
128 */128 */
129int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);129int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
130 130
131int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt);131int ff_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
132 132
133/**133/**
134 * @}134 * @}
libavutil/pixdesc.c+100−100
@@ -122,8 +122,8 @@ void av_write_image_line(const uint16_t *src, · 121 unmodified lines
122 }122 }
123}123}
124 124
125const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {125const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
126 [PIX_FMT_YUV420P] = {126 [AV_PIX_FMT_YUV420P] = {
127 .name = "yuv420p",127 .name = "yuv420p",
128 .nb_components = 3,128 .nb_components = 3,
129 .log2_chroma_w = 1,129 .log2_chroma_w = 1,
@@ -135,7 +135,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
135 },135 },
136 .flags = PIX_FMT_PLANAR,136 .flags = PIX_FMT_PLANAR,
137 },137 },
138 [PIX_FMT_YUYV422] = {138 [AV_PIX_FMT_YUYV422] = {
139 .name = "yuyv422",139 .name = "yuyv422",
140 .nb_components = 3,140 .nb_components = 3,
141 .log2_chroma_w = 1,141 .log2_chroma_w = 1,
@@ -146,7 +146,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 4 unmodified lines
146 { 0, 3, 4, 0, 7 }, /* V */146 { 0, 3, 4, 0, 7 }, /* V */
147 },147 },
148 },148 },
149 [PIX_FMT_RGB24] = {149 [AV_PIX_FMT_RGB24] = {
150 .name = "rgb24",150 .name = "rgb24",
151 .nb_components = 3,151 .nb_components = 3,
152 .log2_chroma_w = 0,152 .log2_chroma_w = 0,
@@ -158,7 +158,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
158 },158 },
159 .flags = PIX_FMT_RGB,159 .flags = PIX_FMT_RGB,
160 },160 },
161 [PIX_FMT_BGR24] = {161 [AV_PIX_FMT_BGR24] = {
162 .name = "bgr24",162 .name = "bgr24",
163 .nb_components = 3,163 .nb_components = 3,
164 .log2_chroma_w = 0,164 .log2_chroma_w = 0,
@@ -170,7 +170,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
170 },170 },
171 .flags = PIX_FMT_RGB,171 .flags = PIX_FMT_RGB,
172 },172 },
173 [PIX_FMT_YUV422P] = {173 [AV_PIX_FMT_YUV422P] = {
174 .name = "yuv422p",174 .name = "yuv422p",
175 .nb_components = 3,175 .nb_components = 3,
176 .log2_chroma_w = 1,176 .log2_chroma_w = 1,
@@ -182,7 +182,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
182 },182 },
183 .flags = PIX_FMT_PLANAR,183 .flags = PIX_FMT_PLANAR,
184 },184 },
185 [PIX_FMT_YUV444P] = {185 [AV_PIX_FMT_YUV444P] = {
186 .name = "yuv444p",186 .name = "yuv444p",
187 .nb_components = 3,187 .nb_components = 3,
188 .log2_chroma_w = 0,188 .log2_chroma_w = 0,
@@ -194,7 +194,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
194 },194 },
195 .flags = PIX_FMT_PLANAR,195 .flags = PIX_FMT_PLANAR,
196 },196 },
197 [PIX_FMT_YUV410P] = {197 [AV_PIX_FMT_YUV410P] = {
198 .name = "yuv410p",198 .name = "yuv410p",
199 .nb_components = 3,199 .nb_components = 3,
200 .log2_chroma_w = 2,200 .log2_chroma_w = 2,
@@ -206,7 +206,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
206 },206 },
207 .flags = PIX_FMT_PLANAR,207 .flags = PIX_FMT_PLANAR,
208 },208 },
209 [PIX_FMT_YUV411P] = {209 [AV_PIX_FMT_YUV411P] = {
210 .name = "yuv411p",210 .name = "yuv411p",
211 .nb_components = 3,211 .nb_components = 3,
212 .log2_chroma_w = 2,212 .log2_chroma_w = 2,
@@ -218,7 +218,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
218 },218 },
219 .flags = PIX_FMT_PLANAR,219 .flags = PIX_FMT_PLANAR,
220 },220 },
221 [PIX_FMT_GRAY8] = {221 [AV_PIX_FMT_GRAY8] = {
222 .name = "gray",222 .name = "gray",
223 .nb_components = 1,223 .nb_components = 1,
224 .log2_chroma_w = 0,224 .log2_chroma_w = 0,
@@ -227,7 +227,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 2 unmodified lines
227 { 0, 0, 1, 0, 7 }, /* Y */227 { 0, 0, 1, 0, 7 }, /* Y */
228 },228 },
229 },229 },
230 [PIX_FMT_MONOWHITE] = {230 [AV_PIX_FMT_MONOWHITE] = {
231 .name = "monow",231 .name = "monow",
232 .nb_components = 1,232 .nb_components = 1,
233 .log2_chroma_w = 0,233 .log2_chroma_w = 0,
@@ -237,7 +237,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 3 unmodified lines
237 },237 },
238 .flags = PIX_FMT_BITSTREAM,238 .flags = PIX_FMT_BITSTREAM,
239 },239 },
240 [PIX_FMT_MONOBLACK] = {240 [AV_PIX_FMT_MONOBLACK] = {
241 .name = "monob",241 .name = "monob",
242 .nb_components = 1,242 .nb_components = 1,
243 .log2_chroma_w = 0,243 .log2_chroma_w = 0,
@@ -247,7 +247,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 3 unmodified lines
247 },247 },
248 .flags = PIX_FMT_BITSTREAM,248 .flags = PIX_FMT_BITSTREAM,
249 },249 },
250 [PIX_FMT_PAL8] = {250 [AV_PIX_FMT_PAL8] = {
251 .name = "pal8",251 .name = "pal8",
252 .nb_components = 1,252 .nb_components = 1,
253 .log2_chroma_w = 0,253 .log2_chroma_w = 0,
@@ -257,7 +257,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 3 unmodified lines
257 },257 },
258 .flags = PIX_FMT_PAL,258 .flags = PIX_FMT_PAL,
259 },259 },
260 [PIX_FMT_YUVJ420P] = {260 [AV_PIX_FMT_YUVJ420P] = {
261 .name = "yuvj420p",261 .name = "yuvj420p",
262 .nb_components = 3,262 .nb_components = 3,
263 .log2_chroma_w = 1,263 .log2_chroma_w = 1,
@@ -269,7 +269,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
269 },269 },
270 .flags = PIX_FMT_PLANAR,270 .flags = PIX_FMT_PLANAR,
271 },271 },
272 [PIX_FMT_YUVJ422P] = {272 [AV_PIX_FMT_YUVJ422P] = {
273 .name = "yuvj422p",273 .name = "yuvj422p",
274 .nb_components = 3,274 .nb_components = 3,
275 .log2_chroma_w = 1,275 .log2_chroma_w = 1,
@@ -281,7 +281,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
281 },281 },
282 .flags = PIX_FMT_PLANAR,282 .flags = PIX_FMT_PLANAR,
283 },283 },
284 [PIX_FMT_YUVJ444P] = {284 [AV_PIX_FMT_YUVJ444P] = {
285 .name = "yuvj444p",285 .name = "yuvj444p",
286 .nb_components = 3,286 .nb_components = 3,
287 .log2_chroma_w = 0,287 .log2_chroma_w = 0,
@@ -293,15 +293,15 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
293 },293 },
294 .flags = PIX_FMT_PLANAR,294 .flags = PIX_FMT_PLANAR,
295 },295 },
296 [PIX_FMT_XVMC_MPEG2_MC] = {296 [AV_PIX_FMT_XVMC_MPEG2_MC] = {
297 .name = "xvmcmc",297 .name = "xvmcmc",
298 .flags = PIX_FMT_HWACCEL,298 .flags = PIX_FMT_HWACCEL,
299 },299 },
300 [PIX_FMT_XVMC_MPEG2_IDCT] = {300 [AV_PIX_FMT_XVMC_MPEG2_IDCT] = {
301 .name = "xvmcidct",301 .name = "xvmcidct",
302 .flags = PIX_FMT_HWACCEL,302 .flags = PIX_FMT_HWACCEL,
303 },303 },
304 [PIX_FMT_UYVY422] = {304 [AV_PIX_FMT_UYVY422] = {
305 .name = "uyvy422",305 .name = "uyvy422",
306 .nb_components = 3,306 .nb_components = 3,
307 .log2_chroma_w = 1,307 .log2_chroma_w = 1,
@@ -312,7 +312,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 4 unmodified lines
312 { 0, 3, 3, 0, 7 }, /* V */312 { 0, 3, 3, 0, 7 }, /* V */
313 },313 },
314 },314 },
315 [PIX_FMT_UYYVYY411] = {315 [AV_PIX_FMT_UYYVYY411] = {
316 .name = "uyyvyy411",316 .name = "uyyvyy411",
317 .nb_components = 3,317 .nb_components = 3,
318 .log2_chroma_w = 2,318 .log2_chroma_w = 2,
@@ -323,7 +323,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 4 unmodified lines
323 { 0, 5, 4, 0, 7 }, /* V */323 { 0, 5, 4, 0, 7 }, /* V */
324 },324 },
325 },325 },
326 [PIX_FMT_BGR8] = {326 [AV_PIX_FMT_BGR8] = {
327 .name = "bgr8",327 .name = "bgr8",
328 .nb_components = 3,328 .nb_components = 3,
329 .log2_chroma_w = 0,329 .log2_chroma_w = 0,
@@ -335,7 +335,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
335 },335 },
336 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,336 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
337 },337 },
338 [PIX_FMT_BGR4] = {338 [AV_PIX_FMT_BGR4] = {
339 .name = "bgr4",339 .name = "bgr4",
340 .nb_components = 3,340 .nb_components = 3,
341 .log2_chroma_w = 0,341 .log2_chroma_w = 0,
@@ -347,7 +347,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
347 },347 },
348 .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,348 .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
349 },349 },
350 [PIX_FMT_BGR4_BYTE] = {350 [AV_PIX_FMT_BGR4_BYTE] = {
351 .name = "bgr4_byte",351 .name = "bgr4_byte",
352 .nb_components = 3,352 .nb_components = 3,
353 .log2_chroma_w = 0,353 .log2_chroma_w = 0,
@@ -359,7 +359,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
359 },359 },
360 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,360 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
361 },361 },
362 [PIX_FMT_RGB8] = {362 [AV_PIX_FMT_RGB8] = {
363 .name = "rgb8",363 .name = "rgb8",
364 .nb_components = 3,364 .nb_components = 3,
365 .log2_chroma_w = 0,365 .log2_chroma_w = 0,
@@ -371,7 +371,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
371 },371 },
372 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,372 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
373 },373 },
374 [PIX_FMT_RGB4] = {374 [AV_PIX_FMT_RGB4] = {
375 .name = "rgb4",375 .name = "rgb4",
376 .nb_components = 3,376 .nb_components = 3,
377 .log2_chroma_w = 0,377 .log2_chroma_w = 0,
@@ -383,7 +383,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
383 },383 },
384 .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,384 .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
385 },385 },
386 [PIX_FMT_RGB4_BYTE] = {386 [AV_PIX_FMT_RGB4_BYTE] = {
387 .name = "rgb4_byte",387 .name = "rgb4_byte",
388 .nb_components = 3,388 .nb_components = 3,
389 .log2_chroma_w = 0,389 .log2_chroma_w = 0,
@@ -395,7 +395,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
395 },395 },
396 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,396 .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
397 },397 },
398 [PIX_FMT_NV12] = {398 [AV_PIX_FMT_NV12] = {
399 .name = "nv12",399 .name = "nv12",
400 .nb_components = 3,400 .nb_components = 3,
401 .log2_chroma_w = 1,401 .log2_chroma_w = 1,
@@ -407,7 +407,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
407 },407 },
408 .flags = PIX_FMT_PLANAR,408 .flags = PIX_FMT_PLANAR,
409 },409 },
410 [PIX_FMT_NV21] = {410 [AV_PIX_FMT_NV21] = {
411 .name = "nv21",411 .name = "nv21",
412 .nb_components = 3,412 .nb_components = 3,
413 .log2_chroma_w = 1,413 .log2_chroma_w = 1,
@@ -419,7 +419,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
419 },419 },
420 .flags = PIX_FMT_PLANAR,420 .flags = PIX_FMT_PLANAR,
421 },421 },
422 [PIX_FMT_ARGB] = {422 [AV_PIX_FMT_ARGB] = {
423 .name = "argb",423 .name = "argb",
424 .nb_components = 4,424 .nb_components = 4,
425 .log2_chroma_w = 0,425 .log2_chroma_w = 0,
@@ -432,7 +432,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 6 unmodified lines
432 },432 },
433 .flags = PIX_FMT_RGB,433 .flags = PIX_FMT_RGB,
434 },434 },
435 [PIX_FMT_RGBA] = {435 [AV_PIX_FMT_RGBA] = {
436 .name = "rgba",436 .name = "rgba",
437 .nb_components = 4,437 .nb_components = 4,
438 .log2_chroma_w = 0,438 .log2_chroma_w = 0,
@@ -445,7 +445,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 6 unmodified lines
445 },445 },
446 .flags = PIX_FMT_RGB,446 .flags = PIX_FMT_RGB,
447 },447 },
448 [PIX_FMT_ABGR] = {448 [AV_PIX_FMT_ABGR] = {
449 .name = "abgr",449 .name = "abgr",
450 .nb_components = 4,450 .nb_components = 4,
451 .log2_chroma_w = 0,451 .log2_chroma_w = 0,
@@ -458,7 +458,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 6 unmodified lines
458 },458 },
459 .flags = PIX_FMT_RGB,459 .flags = PIX_FMT_RGB,
460 },460 },
461 [PIX_FMT_BGRA] = {461 [AV_PIX_FMT_BGRA] = {
462 .name = "bgra",462 .name = "bgra",
463 .nb_components = 4,463 .nb_components = 4,
464 .log2_chroma_w = 0,464 .log2_chroma_w = 0,
@@ -471,7 +471,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 6 unmodified lines
471 },471 },
472 .flags = PIX_FMT_RGB,472 .flags = PIX_FMT_RGB,
473 },473 },
474 [PIX_FMT_GRAY16BE] = {474 [AV_PIX_FMT_GRAY16BE] = {
475 .name = "gray16be",475 .name = "gray16be",
476 .nb_components = 1,476 .nb_components = 1,
477 .log2_chroma_w = 0,477 .log2_chroma_w = 0,
@@ -481,7 +481,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 3 unmodified lines
481 },481 },
482 .flags = PIX_FMT_BE,482 .flags = PIX_FMT_BE,
483 },483 },
484 [PIX_FMT_GRAY16LE] = {484 [AV_PIX_FMT_GRAY16LE] = {
485 .name = "gray16le",485 .name = "gray16le",
486 .nb_components = 1,486 .nb_components = 1,
487 .log2_chroma_w = 0,487 .log2_chroma_w = 0,
@@ -490,7 +490,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 2 unmodified lines
490 { 0, 1, 1, 0, 15 }, /* Y */490 { 0, 1, 1, 0, 15 }, /* Y */
491 },491 },
492 },492 },
493 [PIX_FMT_YUV440P] = {493 [AV_PIX_FMT_YUV440P] = {
494 .name = "yuv440p",494 .name = "yuv440p",
495 .nb_components = 3,495 .nb_components = 3,
496 .log2_chroma_w = 0,496 .log2_chroma_w = 0,
@@ -502,7 +502,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
502 },502 },
503 .flags = PIX_FMT_PLANAR,503 .flags = PIX_FMT_PLANAR,
504 },504 },
505 [PIX_FMT_YUVJ440P] = {505 [AV_PIX_FMT_YUVJ440P] = {
506 .name = "yuvj440p",506 .name = "yuvj440p",
507 .nb_components = 3,507 .nb_components = 3,
508 .log2_chroma_w = 0,508 .log2_chroma_w = 0,
@@ -514,7 +514,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
514 },514 },
515 .flags = PIX_FMT_PLANAR,515 .flags = PIX_FMT_PLANAR,
516 },516 },
517 [PIX_FMT_YUVA420P] = {517 [AV_PIX_FMT_YUVA420P] = {
518 .name = "yuva420p",518 .name = "yuva420p",
519 .nb_components = 4,519 .nb_components = 4,
520 .log2_chroma_w = 1,520 .log2_chroma_w = 1,
@@ -527,43 +527,43 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 6 unmodified lines
527 },527 },
528 .flags = PIX_FMT_PLANAR,528 .flags = PIX_FMT_PLANAR,
529 },529 },
530 [PIX_FMT_VDPAU_H264] = {530 [AV_PIX_FMT_VDPAU_H264] = {
531 .name = "vdpau_h264",531 .name = "vdpau_h264",
532 .log2_chroma_w = 1,532 .log2_chroma_w = 1,
533 .log2_chroma_h = 1,533 .log2_chroma_h = 1,
534 .flags = PIX_FMT_HWACCEL,534 .flags = PIX_FMT_HWACCEL,
535 },535 },
536 [PIX_FMT_VDPAU_MPEG1] = {536 [AV_PIX_FMT_VDPAU_MPEG1] = {
537 .name = "vdpau_mpeg1",537 .name = "vdpau_mpeg1",
538 .log2_chroma_w = 1,538 .log2_chroma_w = 1,
539 .log2_chroma_h = 1,539 .log2_chroma_h = 1,
540 .flags = PIX_FMT_HWACCEL,540 .flags = PIX_FMT_HWACCEL,
541 },541 },
542 [PIX_FMT_VDPAU_MPEG2] = {542 [AV_PIX_FMT_VDPAU_MPEG2] = {
543 .name = "vdpau_mpeg2",543 .name = "vdpau_mpeg2",
544 .log2_chroma_w = 1,544 .log2_chroma_w = 1,
545 .log2_chroma_h = 1,545 .log2_chroma_h = 1,
546 .flags = PIX_FMT_HWACCEL,546 .flags = PIX_FMT_HWACCEL,
547 },547 },
548 [PIX_FMT_VDPAU_WMV3] = {548 [AV_PIX_FMT_VDPAU_WMV3] = {
549 .name = "vdpau_wmv3",549 .name = "vdpau_wmv3",
550 .log2_chroma_w = 1,550 .log2_chroma_w = 1,
551 .log2_chroma_h = 1,551 .log2_chroma_h = 1,
552 .flags = PIX_FMT_HWACCEL,552 .flags = PIX_FMT_HWACCEL,
553 },553 },
554 [PIX_FMT_VDPAU_VC1] = {554 [AV_PIX_FMT_VDPAU_VC1] = {
555 .name = "vdpau_vc1",555 .name = "vdpau_vc1",
556 .log2_chroma_w = 1,556 .log2_chroma_w = 1,
557 .log2_chroma_h = 1,557 .log2_chroma_h = 1,
558 .flags = PIX_FMT_HWACCEL,558 .flags = PIX_FMT_HWACCEL,
559 },559 },
560 [PIX_FMT_VDPAU_MPEG4] = {560 [AV_PIX_FMT_VDPAU_MPEG4] = {
561 .name = "vdpau_mpeg4",561 .name = "vdpau_mpeg4",
562 .log2_chroma_w = 1,562 .log2_chroma_w = 1,
563 .log2_chroma_h = 1,563 .log2_chroma_h = 1,
564 .flags = PIX_FMT_HWACCEL,564 .flags = PIX_FMT_HWACCEL,
565 },565 },
566 [PIX_FMT_RGB48BE] = {566 [AV_PIX_FMT_RGB48BE] = {
567 .name = "rgb48be",567 .name = "rgb48be",
568 .nb_components = 3,568 .nb_components = 3,
569 .log2_chroma_w = 0,569 .log2_chroma_w = 0,
@@ -575,7 +575,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
575 },575 },
576 .flags = PIX_FMT_RGB | PIX_FMT_BE,576 .flags = PIX_FMT_RGB | PIX_FMT_BE,
577 },577 },
578 [PIX_FMT_RGB48LE] = {578 [AV_PIX_FMT_RGB48LE] = {
579 .name = "rgb48le",579 .name = "rgb48le",
580 .nb_components = 3,580 .nb_components = 3,
581 .log2_chroma_w = 0,581 .log2_chroma_w = 0,
@@ -587,7 +587,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
587 },587 },
588 .flags = PIX_FMT_RGB,588 .flags = PIX_FMT_RGB,
589 },589 },
590 [PIX_FMT_RGB565BE] = {590 [AV_PIX_FMT_RGB565BE] = {
591 .name = "rgb565be",591 .name = "rgb565be",
592 .nb_components = 3,592 .nb_components = 3,
593 .log2_chroma_w = 0,593 .log2_chroma_w = 0,
@@ -599,7 +599,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
599 },599 },
600 .flags = PIX_FMT_BE | PIX_FMT_RGB,600 .flags = PIX_FMT_BE | PIX_FMT_RGB,
601 },601 },
602 [PIX_FMT_RGB565LE] = {602 [AV_PIX_FMT_RGB565LE] = {
603 .name = "rgb565le",603 .name = "rgb565le",
604 .nb_components = 3,604 .nb_components = 3,
605 .log2_chroma_w = 0,605 .log2_chroma_w = 0,
@@ -611,7 +611,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
611 },611 },
612 .flags = PIX_FMT_RGB,612 .flags = PIX_FMT_RGB,
613 },613 },
614 [PIX_FMT_RGB555BE] = {614 [AV_PIX_FMT_RGB555BE] = {
615 .name = "rgb555be",615 .name = "rgb555be",
616 .nb_components = 3,616 .nb_components = 3,
617 .log2_chroma_w = 0,617 .log2_chroma_w = 0,
@@ -623,7 +623,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
623 },623 },
624 .flags = PIX_FMT_BE | PIX_FMT_RGB,624 .flags = PIX_FMT_BE | PIX_FMT_RGB,
625 },625 },
626 [PIX_FMT_RGB555LE] = {626 [AV_PIX_FMT_RGB555LE] = {
627 .name = "rgb555le",627 .name = "rgb555le",
628 .nb_components = 3,628 .nb_components = 3,
629 .log2_chroma_w = 0,629 .log2_chroma_w = 0,
@@ -635,7 +635,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
635 },635 },
636 .flags = PIX_FMT_RGB,636 .flags = PIX_FMT_RGB,
637 },637 },
638 [PIX_FMT_RGB444BE] = {638 [AV_PIX_FMT_RGB444BE] = {
639 .name = "rgb444be",639 .name = "rgb444be",
640 .nb_components = 3,640 .nb_components = 3,
641 .log2_chroma_w = 0,641 .log2_chroma_w = 0,
@@ -647,7 +647,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
647 },647 },
648 .flags = PIX_FMT_BE | PIX_FMT_RGB,648 .flags = PIX_FMT_BE | PIX_FMT_RGB,
649 },649 },
650 [PIX_FMT_RGB444LE] = {650 [AV_PIX_FMT_RGB444LE] = {
651 .name = "rgb444le",651 .name = "rgb444le",
652 .nb_components = 3,652 .nb_components = 3,
653 .log2_chroma_w = 0,653 .log2_chroma_w = 0,
@@ -659,7 +659,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
659 },659 },
660 .flags = PIX_FMT_RGB,660 .flags = PIX_FMT_RGB,
661 },661 },
662 [PIX_FMT_BGR48BE] = {662 [AV_PIX_FMT_BGR48BE] = {
663 .name = "bgr48be",663 .name = "bgr48be",
664 .nb_components = 3,664 .nb_components = 3,
665 .log2_chroma_w = 0,665 .log2_chroma_w = 0,
@@ -671,7 +671,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
671 },671 },
672 .flags = PIX_FMT_BE | PIX_FMT_RGB,672 .flags = PIX_FMT_BE | PIX_FMT_RGB,
673 },673 },
674 [PIX_FMT_BGR48LE] = {674 [AV_PIX_FMT_BGR48LE] = {
675 .name = "bgr48le",675 .name = "bgr48le",
676 .nb_components = 3,676 .nb_components = 3,
677 .log2_chroma_w = 0,677 .log2_chroma_w = 0,
@@ -683,7 +683,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
683 },683 },
684 .flags = PIX_FMT_RGB,684 .flags = PIX_FMT_RGB,
685 },685 },
686 [PIX_FMT_BGR565BE] = {686 [AV_PIX_FMT_BGR565BE] = {
687 .name = "bgr565be",687 .name = "bgr565be",
688 .nb_components = 3,688 .nb_components = 3,
689 .log2_chroma_w = 0,689 .log2_chroma_w = 0,
@@ -695,7 +695,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
695 },695 },
696 .flags = PIX_FMT_BE | PIX_FMT_RGB,696 .flags = PIX_FMT_BE | PIX_FMT_RGB,
697 },697 },
698 [PIX_FMT_BGR565LE] = {698 [AV_PIX_FMT_BGR565LE] = {
699 .name = "bgr565le",699 .name = "bgr565le",
700 .nb_components = 3,700 .nb_components = 3,
701 .log2_chroma_w = 0,701 .log2_chroma_w = 0,
@@ -707,7 +707,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
707 },707 },
708 .flags = PIX_FMT_RGB,708 .flags = PIX_FMT_RGB,
709 },709 },
710 [PIX_FMT_BGR555BE] = {710 [AV_PIX_FMT_BGR555BE] = {
711 .name = "bgr555be",711 .name = "bgr555be",
712 .nb_components = 3,712 .nb_components = 3,
713 .log2_chroma_w = 0,713 .log2_chroma_w = 0,
@@ -719,7 +719,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
719 },719 },
720 .flags = PIX_FMT_BE | PIX_FMT_RGB,720 .flags = PIX_FMT_BE | PIX_FMT_RGB,
721 },721 },
722 [PIX_FMT_BGR555LE] = {722 [AV_PIX_FMT_BGR555LE] = {
723 .name = "bgr555le",723 .name = "bgr555le",
724 .nb_components = 3,724 .nb_components = 3,
725 .log2_chroma_w = 0,725 .log2_chroma_w = 0,
@@ -731,7 +731,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
731 },731 },
732 .flags = PIX_FMT_RGB,732 .flags = PIX_FMT_RGB,
733 },733 },
734 [PIX_FMT_BGR444BE] = {734 [AV_PIX_FMT_BGR444BE] = {
735 .name = "bgr444be",735 .name = "bgr444be",
736 .nb_components = 3,736 .nb_components = 3,
737 .log2_chroma_w = 0,737 .log2_chroma_w = 0,
@@ -743,7 +743,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
743 },743 },
744 .flags = PIX_FMT_BE | PIX_FMT_RGB,744 .flags = PIX_FMT_BE | PIX_FMT_RGB,
745 },745 },
746 [PIX_FMT_BGR444LE] = {746 [AV_PIX_FMT_BGR444LE] = {
747 .name = "bgr444le",747 .name = "bgr444le",
748 .nb_components = 3,748 .nb_components = 3,
749 .log2_chroma_w = 0,749 .log2_chroma_w = 0,
@@ -755,31 +755,31 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
755 },755 },
756 .flags = PIX_FMT_RGB,756 .flags = PIX_FMT_RGB,
757 },757 },
758 [PIX_FMT_VAAPI_MOCO] = {758 [AV_PIX_FMT_VAAPI_MOCO] = {
759 .name = "vaapi_moco",759 .name = "vaapi_moco",
760 .log2_chroma_w = 1,760 .log2_chroma_w = 1,
761 .log2_chroma_h = 1,761 .log2_chroma_h = 1,
762 .flags = PIX_FMT_HWACCEL,762 .flags = PIX_FMT_HWACCEL,
763 },763 },
764 [PIX_FMT_VAAPI_IDCT] = {764 [AV_PIX_FMT_VAAPI_IDCT] = {
765 .name = "vaapi_idct",765 .name = "vaapi_idct",
766 .log2_chroma_w = 1,766 .log2_chroma_w = 1,
767 .log2_chroma_h = 1,767 .log2_chroma_h = 1,
768 .flags = PIX_FMT_HWACCEL,768 .flags = PIX_FMT_HWACCEL,
769 },769 },
770 [PIX_FMT_VAAPI_VLD] = {770 [AV_PIX_FMT_VAAPI_VLD] = {
771 .name = "vaapi_vld",771 .name = "vaapi_vld",
772 .log2_chroma_w = 1,772 .log2_chroma_w = 1,
773 .log2_chroma_h = 1,773 .log2_chroma_h = 1,
774 .flags = PIX_FMT_HWACCEL,774 .flags = PIX_FMT_HWACCEL,
775 },775 },
776 [PIX_FMT_VDA_VLD] = {776 [AV_PIX_FMT_VDA_VLD] = {
777 .name = "vda_vld",777 .name = "vda_vld",
778 .log2_chroma_w = 1,778 .log2_chroma_w = 1,
779 .log2_chroma_h = 1,779 .log2_chroma_h = 1,
780 .flags = PIX_FMT_HWACCEL,780 .flags = PIX_FMT_HWACCEL,
781 },781 },
782 [PIX_FMT_YUV420P9LE] = {782 [AV_PIX_FMT_YUV420P9LE] = {
783 .name = "yuv420p9le",783 .name = "yuv420p9le",
784 .nb_components = 3,784 .nb_components = 3,
785 .log2_chroma_w = 1,785 .log2_chroma_w = 1,
@@ -791,7 +791,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
791 },791 },
792 .flags = PIX_FMT_PLANAR,792 .flags = PIX_FMT_PLANAR,
793 },793 },
794 [PIX_FMT_YUV420P9BE] = {794 [AV_PIX_FMT_YUV420P9BE] = {
795 .name = "yuv420p9be",795 .name = "yuv420p9be",
796 .nb_components = 3,796 .nb_components = 3,
797 .log2_chroma_w = 1,797 .log2_chroma_w = 1,
@@ -803,7 +803,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
803 },803 },
804 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,804 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
805 },805 },
806 [PIX_FMT_YUV420P10LE] = {806 [AV_PIX_FMT_YUV420P10LE] = {
807 .name = "yuv420p10le",807 .name = "yuv420p10le",
808 .nb_components = 3,808 .nb_components = 3,
809 .log2_chroma_w = 1,809 .log2_chroma_w = 1,
@@ -815,7 +815,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
815 },815 },
816 .flags = PIX_FMT_PLANAR,816 .flags = PIX_FMT_PLANAR,
817 },817 },
818 [PIX_FMT_YUV420P10BE] = {818 [AV_PIX_FMT_YUV420P10BE] = {
819 .name = "yuv420p10be",819 .name = "yuv420p10be",
820 .nb_components = 3,820 .nb_components = 3,
821 .log2_chroma_w = 1,821 .log2_chroma_w = 1,
@@ -827,7 +827,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
827 },827 },
828 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,828 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
829 },829 },
830 [PIX_FMT_YUV420P16LE] = {830 [AV_PIX_FMT_YUV420P16LE] = {
831 .name = "yuv420p16le",831 .name = "yuv420p16le",
832 .nb_components = 3,832 .nb_components = 3,
833 .log2_chroma_w = 1,833 .log2_chroma_w = 1,
@@ -839,7 +839,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
839 },839 },
840 .flags = PIX_FMT_PLANAR,840 .flags = PIX_FMT_PLANAR,
841 },841 },
842 [PIX_FMT_YUV420P16BE] = {842 [AV_PIX_FMT_YUV420P16BE] = {
843 .name = "yuv420p16be",843 .name = "yuv420p16be",
844 .nb_components = 3,844 .nb_components = 3,
845 .log2_chroma_w = 1,845 .log2_chroma_w = 1,
@@ -851,7 +851,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
851 },851 },
852 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,852 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
853 },853 },
854 [PIX_FMT_YUV422P9LE] = {854 [AV_PIX_FMT_YUV422P9LE] = {
855 .name = "yuv422p9le",855 .name = "yuv422p9le",
856 .nb_components = 3,856 .nb_components = 3,
857 .log2_chroma_w = 1,857 .log2_chroma_w = 1,
@@ -863,7 +863,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
863 },863 },
864 .flags = PIX_FMT_PLANAR,864 .flags = PIX_FMT_PLANAR,
865 },865 },
866 [PIX_FMT_YUV422P9BE] = {866 [AV_PIX_FMT_YUV422P9BE] = {
867 .name = "yuv422p9be",867 .name = "yuv422p9be",
868 .nb_components = 3,868 .nb_components = 3,
869 .log2_chroma_w = 1,869 .log2_chroma_w = 1,
@@ -875,7 +875,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
875 },875 },
876 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,876 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
877 },877 },
878 [PIX_FMT_YUV422P10LE] = {878 [AV_PIX_FMT_YUV422P10LE] = {
879 .name = "yuv422p10le",879 .name = "yuv422p10le",
880 .nb_components = 3,880 .nb_components = 3,
881 .log2_chroma_w = 1,881 .log2_chroma_w = 1,
@@ -887,7 +887,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
887 },887 },
888 .flags = PIX_FMT_PLANAR,888 .flags = PIX_FMT_PLANAR,
889 },889 },
890 [PIX_FMT_YUV422P10BE] = {890 [AV_PIX_FMT_YUV422P10BE] = {
891 .name = "yuv422p10be",891 .name = "yuv422p10be",
892 .nb_components = 3,892 .nb_components = 3,
893 .log2_chroma_w = 1,893 .log2_chroma_w = 1,
@@ -899,7 +899,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
899 },899 },
900 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,900 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
901 },901 },
902 [PIX_FMT_YUV422P16LE] = {902 [AV_PIX_FMT_YUV422P16LE] = {
903 .name = "yuv422p16le",903 .name = "yuv422p16le",
904 .nb_components = 3,904 .nb_components = 3,
905 .log2_chroma_w = 1,905 .log2_chroma_w = 1,
@@ -911,7 +911,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
911 },911 },
912 .flags = PIX_FMT_PLANAR,912 .flags = PIX_FMT_PLANAR,
913 },913 },
914 [PIX_FMT_YUV422P16BE] = {914 [AV_PIX_FMT_YUV422P16BE] = {
915 .name = "yuv422p16be",915 .name = "yuv422p16be",
916 .nb_components = 3,916 .nb_components = 3,
917 .log2_chroma_w = 1,917 .log2_chroma_w = 1,
@@ -923,7 +923,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
923 },923 },
924 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,924 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
925 },925 },
926 [PIX_FMT_YUV444P16LE] = {926 [AV_PIX_FMT_YUV444P16LE] = {
927 .name = "yuv444p16le",927 .name = "yuv444p16le",
928 .nb_components = 3,928 .nb_components = 3,
929 .log2_chroma_w = 0,929 .log2_chroma_w = 0,
@@ -935,7 +935,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
935 },935 },
936 .flags = PIX_FMT_PLANAR,936 .flags = PIX_FMT_PLANAR,
937 },937 },
938 [PIX_FMT_YUV444P16BE] = {938 [AV_PIX_FMT_YUV444P16BE] = {
939 .name = "yuv444p16be",939 .name = "yuv444p16be",
940 .nb_components = 3,940 .nb_components = 3,
941 .log2_chroma_w = 0,941 .log2_chroma_w = 0,
@@ -947,7 +947,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
947 },947 },
948 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,948 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
949 },949 },
950 [PIX_FMT_YUV444P10LE] = {950 [AV_PIX_FMT_YUV444P10LE] = {
951 .name = "yuv444p10le",951 .name = "yuv444p10le",
952 .nb_components = 3,952 .nb_components = 3,
953 .log2_chroma_w = 0,953 .log2_chroma_w = 0,
@@ -959,7 +959,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
959 },959 },
960 .flags = PIX_FMT_PLANAR,960 .flags = PIX_FMT_PLANAR,
961 },961 },
962 [PIX_FMT_YUV444P10BE] = {962 [AV_PIX_FMT_YUV444P10BE] = {
963 .name = "yuv444p10be",963 .name = "yuv444p10be",
964 .nb_components = 3,964 .nb_components = 3,
965 .log2_chroma_w = 0,965 .log2_chroma_w = 0,
@@ -971,7 +971,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
971 },971 },
972 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,972 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
973 },973 },
974 [PIX_FMT_YUV444P9LE] = {974 [AV_PIX_FMT_YUV444P9LE] = {
975 .name = "yuv444p9le",975 .name = "yuv444p9le",
976 .nb_components = 3,976 .nb_components = 3,
977 .log2_chroma_w = 0,977 .log2_chroma_w = 0,
@@ -983,7 +983,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
983 },983 },
984 .flags = PIX_FMT_PLANAR,984 .flags = PIX_FMT_PLANAR,
985 },985 },
986 [PIX_FMT_YUV444P9BE] = {986 [AV_PIX_FMT_YUV444P9BE] = {
987 .name = "yuv444p9be",987 .name = "yuv444p9be",
988 .nb_components = 3,988 .nb_components = 3,
989 .log2_chroma_w = 0,989 .log2_chroma_w = 0,
@@ -995,13 +995,13 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
995 },995 },
996 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,996 .flags = PIX_FMT_BE | PIX_FMT_PLANAR,
997 },997 },
998 [PIX_FMT_DXVA2_VLD] = {998 [AV_PIX_FMT_DXVA2_VLD] = {
999 .name = "dxva2_vld",999 .name = "dxva2_vld",
1000 .log2_chroma_w = 1,1000 .log2_chroma_w = 1,
1001 .log2_chroma_h = 1,1001 .log2_chroma_h = 1,
1002 .flags = PIX_FMT_HWACCEL,1002 .flags = PIX_FMT_HWACCEL,
1003 },1003 },
1004 [PIX_FMT_Y400A] = {1004 [AV_PIX_FMT_Y400A] = {
1005 .name = "y400a",1005 .name = "y400a",
1006 .nb_components = 2,1006 .nb_components = 2,
1007 .comp = {1007 .comp = {
@@ -1009,7 +1009,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 1 unmodified line
1009 { 0, 1, 2, 0, 7 }, /* A */1009 { 0, 1, 2, 0, 7 }, /* A */
1010 },1010 },
1011 },1011 },
1012 [PIX_FMT_GBRP] = {1012 [AV_PIX_FMT_GBRP] = {
1013 .name = "gbrp",1013 .name = "gbrp",
1014 .nb_components = 3,1014 .nb_components = 3,
1015 .log2_chroma_w = 0,1015 .log2_chroma_w = 0,
@@ -1021,7 +1021,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
1021 },1021 },
1022 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,1022 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1023 },1023 },
1024 [PIX_FMT_GBRP9LE] = {1024 [AV_PIX_FMT_GBRP9LE] = {
1025 .name = "gbrp9le",1025 .name = "gbrp9le",
1026 .nb_components = 3,1026 .nb_components = 3,
1027 .log2_chroma_w = 0,1027 .log2_chroma_w = 0,
@@ -1033,7 +1033,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
1033 },1033 },
1034 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,1034 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1035 },1035 },
1036 [PIX_FMT_GBRP9BE] = {1036 [AV_PIX_FMT_GBRP9BE] = {
1037 .name = "gbrp9be",1037 .name = "gbrp9be",
1038 .nb_components = 3,1038 .nb_components = 3,
1039 .log2_chroma_w = 0,1039 .log2_chroma_w = 0,
@@ -1045,7 +1045,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
1045 },1045 },
1046 .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,1046 .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1047 },1047 },
1048 [PIX_FMT_GBRP10LE] = {1048 [AV_PIX_FMT_GBRP10LE] = {
1049 .name = "gbrp10le",1049 .name = "gbrp10le",
1050 .nb_components = 3,1050 .nb_components = 3,
1051 .log2_chroma_w = 0,1051 .log2_chroma_w = 0,
@@ -1057,7 +1057,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
1057 },1057 },
1058 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,1058 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1059 },1059 },
1060 [PIX_FMT_GBRP10BE] = {1060 [AV_PIX_FMT_GBRP10BE] = {
1061 .name = "gbrp10be",1061 .name = "gbrp10be",
1062 .nb_components = 3,1062 .nb_components = 3,
1063 .log2_chroma_w = 0,1063 .log2_chroma_w = 0,
@@ -1069,7 +1069,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
1069 },1069 },
1070 .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,1070 .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
1071 },1071 },
1072 [PIX_FMT_GBRP16LE] = {1072 [AV_PIX_FMT_GBRP16LE] = {
1073 .name = "gbrp16le",1073 .name = "gbrp16le",
1074 .nb_components = 3,1074 .nb_components = 3,
1075 .log2_chroma_w = 0,1075 .log2_chroma_w = 0,
@@ -1081,7 +1081,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 5 unmodified lines
1081 },1081 },
1082 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,1082 .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
1083 },1083 },
1084 [PIX_FMT_GBRP16BE] = {1084 [AV_PIX_FMT_GBRP16BE] = {
1085 .name = "gbrp16be",1085 .name = "gbrp16be",
1086 .nb_components = 3,1086 .nb_components = 3,
1087 .log2_chroma_w = 0,1087 .log2_chroma_w = 0,
@@ -1095,21 +1095,21 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { · 7 unmodified lines
1095 },1095 },
1096};1096};
1097 1097
1098static enum PixelFormat get_pix_fmt_internal(const char *name)1098static enum AVPixelFormat get_pix_fmt_internal(const char *name)
1099{1099{
1100 enum PixelFormat pix_fmt;1100 enum AVPixelFormat pix_fmt;
1101 1101
1102 for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++)1102 for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++)
1103 if (av_pix_fmt_descriptors[pix_fmt].name &&1103 if (av_pix_fmt_descriptors[pix_fmt].name &&
1104 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))1104 !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name))
1105 return pix_fmt;1105 return pix_fmt;
1106 1106
1107 return PIX_FMT_NONE;1107 return AV_PIX_FMT_NONE;
1108}1108}
1109 1109
1110const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt)1110const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
1111{1111{
1112 return (unsigned)pix_fmt < PIX_FMT_NB ?1112 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
1113 av_pix_fmt_descriptors[pix_fmt].name : NULL;1113 av_pix_fmt_descriptors[pix_fmt].name : NULL;
1114}1114}
1115 1115
@@ -1119,9 +1119,9 @@ const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt) · 3 unmodified lines
1119# define X_NE(be, le) le1119# define X_NE(be, le) le
1120#endif1120#endif
1121 1121
1122enum PixelFormat av_get_pix_fmt(const char *name)1122enum AVPixelFormat av_get_pix_fmt(const char *name)
1123{1123{
1124 enum PixelFormat pix_fmt;1124 enum AVPixelFormat pix_fmt;
1125 1125
1126 if (!strcmp(name, "rgb32"))1126 if (!strcmp(name, "rgb32"))
1127 name = X_NE("argb", "bgra");1127 name = X_NE("argb", "bgra");
@@ -1129,7 +1129,7 @@ enum PixelFormat av_get_pix_fmt(const char *name) · 1 unmodified line
1129 name = X_NE("abgr", "rgba");1129 name = X_NE("abgr", "rgba");
1130 1130
1131 pix_fmt = get_pix_fmt_internal(name);1131 pix_fmt = get_pix_fmt_internal(name);
1132 if (pix_fmt == PIX_FMT_NONE) {1132 if (pix_fmt == AV_PIX_FMT_NONE) {
1133 char name2[32];1133 char name2[32];
1134 1134
1135 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));1135 snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
@@ -1151,7 +1151,7 @@ int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) · 15 unmodified lines
1151 return bits >> log2_pixels;1151 return bits >> log2_pixels;
1152}1152}
1153 1153
1154char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)1154char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt)
1155{1155{
1156 /* print header */1156 /* print header */
1157 if (pix_fmt < 0) {1157 if (pix_fmt < 0) {
libavutil/pixdesc.h+3−3
@@ -148,7 +148,7 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi · 147 unmodified lines
148 *148 *
149 * Finally if no pixel format has been found, returns PIX_FMT_NONE.149 * Finally if no pixel format has been found, returns PIX_FMT_NONE.
150 */150 */
151enum PixelFormat av_get_pix_fmt(const char *name);151enum AVPixelFormat av_get_pix_fmt(const char *name);
152 152
153/**153/**
154 * Return the short name for a pixel format, NULL in case pix_fmt is154 * Return the short name for a pixel format, NULL in case pix_fmt is
@@ -156,7 +156,7 @@ enum PixelFormat av_get_pix_fmt(const char *name); · 1 unmodified line
156 *156 *
157 * @see av_get_pix_fmt(), av_get_pix_fmt_string()157 * @see av_get_pix_fmt(), av_get_pix_fmt_string()
158 */158 */
159const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);159const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
160 160
161/**161/**
162 * Print in buf the string corresponding to the pixel format with162 * Print in buf the string corresponding to the pixel format with
@@ -168,7 +168,7 @@ const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt); · 5 unmodified lines
168 * corresponding info string, or a negative value to print the168 * corresponding info string, or a negative value to print the
169 * corresponding header.169 * corresponding header.
170 */170 */
171char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);171char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
172 172
173/**173/**
174 * Return the number of bits per pixel used by the pixel format174 * Return the number of bits per pixel used by the pixel format
libswscale/bfin/swscale_bfin.c+2−2
@@ -73,12 +73,12 @@ static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[], · 72 unmodified lines
73 73
74void ff_bfin_get_unscaled_swscale(SwsContext *c)74void ff_bfin_get_unscaled_swscale(SwsContext *c)
75{75{
76 if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_UYVY422) {76 if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) {
77 av_log(NULL, AV_LOG_VERBOSE,77 av_log(NULL, AV_LOG_VERBOSE,
78 "selecting Blackfin optimized uyvytoyv12_unscaled\n");78 "selecting Blackfin optimized uyvytoyv12_unscaled\n");
79 c->swScale = uyvytoyv12_unscaled;79 c->swScale = uyvytoyv12_unscaled;
80 }80 }
81 if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_YUYV422) {81 if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) {
82 av_log(NULL, AV_LOG_VERBOSE,82 av_log(NULL, AV_LOG_VERBOSE,
83 "selecting Blackfin optimized yuyvtoyv12_unscaled\n");83 "selecting Blackfin optimized yuyvtoyv12_unscaled\n");
84 c->swScale = yuyvtoyv12_unscaled;84 c->swScale = yuyvtoyv12_unscaled;
libswscale/bfin/yuv2rgb_bfin.c+6−6
@@ -172,22 +172,22 @@ SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c) · 171 unmodified lines
172 SwsFunc f;172 SwsFunc f;
173 173
174 switch (c->dstFormat) {174 switch (c->dstFormat) {
175 case PIX_FMT_RGB555:175 case AV_PIX_FMT_RGB555:
176 f = bfin_yuv420_rgb555;176 f = bfin_yuv420_rgb555;
177 break;177 break;
178 case PIX_FMT_BGR555:178 case AV_PIX_FMT_BGR555:
179 f = bfin_yuv420_bgr555;179 f = bfin_yuv420_bgr555;
180 break;180 break;
181 case PIX_FMT_RGB565:181 case AV_PIX_FMT_RGB565:
182 f = bfin_yuv420_rgb565;182 f = bfin_yuv420_rgb565;
183 break;183 break;
184 case PIX_FMT_BGR565:184 case AV_PIX_FMT_BGR565:
185 f = bfin_yuv420_bgr565;185 f = bfin_yuv420_bgr565;
186 break;186 break;
187 case PIX_FMT_RGB24:187 case AV_PIX_FMT_RGB24:
188 f = bfin_yuv420_rgb24;188 f = bfin_yuv420_rgb24;
189 break;189 break;
190 case PIX_FMT_BGR24:190 case AV_PIX_FMT_BGR24:
191 f = bfin_yuv420_bgr24;191 f = bfin_yuv420_bgr24;
192 break;192 break;
193 default:193 default:
libswscale/input.c+177−177
@@ -48,12 +48,12 @@ · 47 unmodified lines
48 48
49#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))49#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
50 50
51#define r ((origin == PIX_FMT_BGR48BE || origin == PIX_FMT_BGR48LE) ? b_r : r_b)51#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? b_r : r_b)
52#define b ((origin == PIX_FMT_BGR48BE || origin == PIX_FMT_BGR48LE) ? r_b : b_r)52#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? r_b : b_r)
53 53
54static av_always_inline void rgb48ToY_c_template(uint16_t *dst,54static av_always_inline void rgb48ToY_c_template(uint16_t *dst,
55 const uint16_t *src, int width,55 const uint16_t *src, int width,
56 enum PixelFormat origin)56 enum AVPixelFormat origin)
57{57{
58 int i;58 int i;
59 for (i = 0; i < width; i++) {59 for (i = 0; i < width; i++) {
@@ -70,7 +70,7 @@ static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU, · 10 unmodified lines
70 const uint16_t *src1,70 const uint16_t *src1,
71 const uint16_t *src2,71 const uint16_t *src2,
72 int width,72 int width,
73 enum PixelFormat origin)73 enum AVPixelFormat origin)
74{74{
75 int i;75 int i;
76 assert(src1 == src2);76 assert(src1 == src2);
@@ -89,7 +89,7 @@ static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU, · 12 unmodified lines
89 const uint16_t *src1,89 const uint16_t *src1,
90 const uint16_t *src2,90 const uint16_t *src2,
91 int width,91 int width,
92 enum PixelFormat origin)92 enum AVPixelFormat origin)
93{93{
94 int i;94 int i;
95 assert(src1 == src2);95 assert(src1 == src2);
@@ -149,15 +149,15 @@ static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \ · 53 unmodified lines
149 rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \149 rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \
150}150}
151 151
152rgb48funcs(rgb, LE, PIX_FMT_RGB48LE)152rgb48funcs(rgb, LE, AV_PIX_FMT_RGB48LE)
153rgb48funcs(rgb, BE, PIX_FMT_RGB48BE)153rgb48funcs(rgb, BE, AV_PIX_FMT_RGB48BE)
154rgb48funcs(bgr, LE, PIX_FMT_BGR48LE)154rgb48funcs(bgr, LE, AV_PIX_FMT_BGR48LE)
155rgb48funcs(bgr, BE, PIX_FMT_BGR48BE)155rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE)
156 156
157#define input_pixel(i) ((origin == PIX_FMT_RGBA || \157#define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \
158 origin == PIX_FMT_BGRA || \158 origin == AV_PIX_FMT_BGRA || \
159 origin == PIX_FMT_ARGB || \159 origin == AV_PIX_FMT_ARGB || \
160 origin == PIX_FMT_ABGR) \160 origin == AV_PIX_FMT_ABGR) \
161 ? AV_RN32A(&src[(i) * 4]) \161 ? AV_RN32A(&src[(i) * 4]) \
162 : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \162 : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \
163 : AV_RL16(&src[(i) * 2])))163 : AV_RL16(&src[(i) * 2])))
@@ -165,7 +165,7 @@ rgb48funcs(bgr, BE, PIX_FMT_BGR48BE) · 1 unmodified line
165static av_always_inline void rgb16_32ToY_c_template(uint8_t *dst,165static av_always_inline void rgb16_32ToY_c_template(uint8_t *dst,
166 const uint8_t *src,166 const uint8_t *src,
167 int width,167 int width,
168 enum PixelFormat origin,168 enum AVPixelFormat origin,
169 int shr, int shg,169 int shr, int shg,
170 int shb, int shp,170 int shb, int shp,
171 int maskr, int maskg,171 int maskr, int maskg,
@@ -190,7 +190,7 @@ static av_always_inline void rgb16_32ToUV_c_template(uint8_t *dstU, · 18 unmodified lines
190 uint8_t *dstV,190 uint8_t *dstV,
191 const uint8_t *src,191 const uint8_t *src,
192 int width,192 int width,
193 enum PixelFormat origin,193 enum AVPixelFormat origin,
194 int shr, int shg,194 int shr, int shg,
195 int shb, int shp,195 int shb, int shp,
196 int maskr, int maskg,196 int maskr, int maskg,
@@ -217,7 +217,7 @@ static av_always_inline void rgb16_32ToUV_half_c_template(uint8_t *dstU, · 20 unmodified lines
217 uint8_t *dstV,217 uint8_t *dstV,
218 const uint8_t *src,218 const uint8_t *src,
219 int width,219 int width,
220 enum PixelFormat origin,220 enum AVPixelFormat origin,
221 int shr, int shg,221 int shr, int shg,
222 int shb, int shp,222 int shb, int shp,
223 int maskr, int maskg,223 int maskr, int maskg,
@@ -241,8 +241,8 @@ static av_always_inline void rgb16_32ToUV_half_c_template(uint8_t *dstU, · 17 unmodified lines
241 241
242 b = (rb & maskb) >> shb;242 b = (rb & maskb) >> shb;
243 if (shp ||243 if (shp ||
244 origin == PIX_FMT_BGR565LE || origin == PIX_FMT_BGR565BE ||244 origin == AV_PIX_FMT_BGR565LE || origin == AV_PIX_FMT_BGR565BE ||
245 origin == PIX_FMT_RGB565LE || origin == PIX_FMT_RGB565BE) {245 origin == AV_PIX_FMT_RGB565LE || origin == AV_PIX_FMT_RGB565BE) {
246 g >>= shg;246 g >>= shg;
247 } else {247 } else {
248 g = (g & maskg) >> shg;248 g = (g & maskg) >> shg;
@@ -285,22 +285,22 @@ static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \ · 36 unmodified lines
285 rsh, gsh, bsh, S); \285 rsh, gsh, bsh, S); \
286}286}
287 287
288rgb16_32_wrapper(PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)288rgb16_32_wrapper(AV_PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
289rgb16_32_wrapper(PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)289rgb16_32_wrapper(AV_PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8)
290rgb16_32_wrapper(PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)290rgb16_32_wrapper(AV_PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
291rgb16_32_wrapper(PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)291rgb16_32_wrapper(AV_PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8)
292rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)292rgb16_32_wrapper(AV_PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
293rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)293rgb16_32_wrapper(AV_PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
294rgb16_32_wrapper(PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)294rgb16_32_wrapper(AV_PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
295rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)295rgb16_32_wrapper(AV_PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
296rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)296rgb16_32_wrapper(AV_PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
297rgb16_32_wrapper(PIX_FMT_RGB444LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)297rgb16_32_wrapper(AV_PIX_FMT_RGB444LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
298rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)298rgb16_32_wrapper(AV_PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8)
299rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)299rgb16_32_wrapper(AV_PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7)
300rgb16_32_wrapper(PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)300rgb16_32_wrapper(AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4)
301rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)301rgb16_32_wrapper(AV_PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8)
302rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)302rgb16_32_wrapper(AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7)
303rgb16_32_wrapper(PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)303rgb16_32_wrapper(AV_PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4)
304 304
305static void abgrToA_c(uint8_t *dst, const uint8_t *src, int width,305static void abgrToA_c(uint8_t *dst, const uint8_t *src, int width,
306 uint32_t *unused)306 uint32_t *unused)
@@ -670,211 +670,211 @@ static void planar_rgb16be_to_uv(uint8_t *dstU, uint8_t *dstV, · 363 unmodified lines
670 670
671av_cold void ff_sws_init_input_funcs(SwsContext *c)671av_cold void ff_sws_init_input_funcs(SwsContext *c)
672{672{
673 enum PixelFormat srcFormat = c->srcFormat;673 enum AVPixelFormat srcFormat = c->srcFormat;
674 674
675 c->chrToYV12 = NULL;675 c->chrToYV12 = NULL;
676 switch (srcFormat) {676 switch (srcFormat) {
677 case PIX_FMT_YUYV422:677 case AV_PIX_FMT_YUYV422:
678 c->chrToYV12 = yuy2ToUV_c;678 c->chrToYV12 = yuy2ToUV_c;
679 break;679 break;
680 case PIX_FMT_UYVY422:680 case AV_PIX_FMT_UYVY422:
681 c->chrToYV12 = uyvyToUV_c;681 c->chrToYV12 = uyvyToUV_c;
682 break;682 break;
683 case PIX_FMT_NV12:683 case AV_PIX_FMT_NV12:
684 c->chrToYV12 = nv12ToUV_c;684 c->chrToYV12 = nv12ToUV_c;
685 break;685 break;
686 case PIX_FMT_NV21:686 case AV_PIX_FMT_NV21:
687 c->chrToYV12 = nv21ToUV_c;687 c->chrToYV12 = nv21ToUV_c;
688 break;688 break;
689 case PIX_FMT_RGB8:689 case AV_PIX_FMT_RGB8:
690 case PIX_FMT_BGR8:690 case AV_PIX_FMT_BGR8:
691 case PIX_FMT_PAL8:691 case AV_PIX_FMT_PAL8:
692 case PIX_FMT_BGR4_BYTE:692 case AV_PIX_FMT_BGR4_BYTE:
693 case PIX_FMT_RGB4_BYTE:693 case AV_PIX_FMT_RGB4_BYTE:
694 c->chrToYV12 = palToUV_c;694 c->chrToYV12 = palToUV_c;
695 break;695 break;
696 case PIX_FMT_GBRP9LE:696 case AV_PIX_FMT_GBRP9LE:
697 c->readChrPlanar = planar_rgb9le_to_uv;697 c->readChrPlanar = planar_rgb9le_to_uv;
698 break;698 break;
699 case PIX_FMT_GBRP10LE:699 case AV_PIX_FMT_GBRP10LE:
700 c->readChrPlanar = planar_rgb10le_to_uv;700 c->readChrPlanar = planar_rgb10le_to_uv;
701 break;701 break;
702 case PIX_FMT_GBRP16LE:702 case AV_PIX_FMT_GBRP16LE:
703 c->readChrPlanar = planar_rgb16le_to_uv;703 c->readChrPlanar = planar_rgb16le_to_uv;
704 break;704 break;
705 case PIX_FMT_GBRP9BE:705 case AV_PIX_FMT_GBRP9BE:
706 c->readChrPlanar = planar_rgb9be_to_uv;706 c->readChrPlanar = planar_rgb9be_to_uv;
707 break;707 break;
708 case PIX_FMT_GBRP10BE:708 case AV_PIX_FMT_GBRP10BE:
709 c->readChrPlanar = planar_rgb10be_to_uv;709 c->readChrPlanar = planar_rgb10be_to_uv;
710 break;710 break;
711 case PIX_FMT_GBRP16BE:711 case AV_PIX_FMT_GBRP16BE:
712 c->readChrPlanar = planar_rgb16be_to_uv;712 c->readChrPlanar = planar_rgb16be_to_uv;
713 break;713 break;
714 case PIX_FMT_GBRP:714 case AV_PIX_FMT_GBRP:
715 c->readChrPlanar = planar_rgb_to_uv;715 c->readChrPlanar = planar_rgb_to_uv;
716 break;716 break;
717#if HAVE_BIGENDIAN717#if HAVE_BIGENDIAN
718 case PIX_FMT_YUV444P9LE:718 case AV_PIX_FMT_YUV444P9LE:
719 case PIX_FMT_YUV422P9LE:719 case AV_PIX_FMT_YUV422P9LE:
720 case PIX_FMT_YUV420P9LE:720 case AV_PIX_FMT_YUV420P9LE:
721 case PIX_FMT_YUV422P10LE:721 case AV_PIX_FMT_YUV422P10LE:
722 case PIX_FMT_YUV444P10LE:722 case AV_PIX_FMT_YUV444P10LE:
723 case PIX_FMT_YUV420P10LE:723 case AV_PIX_FMT_YUV420P10LE:
724 case PIX_FMT_YUV420P16LE:724 case AV_PIX_FMT_YUV420P16LE:
725 case PIX_FMT_YUV422P16LE:725 case AV_PIX_FMT_YUV422P16LE:
726 case PIX_FMT_YUV444P16LE:726 case AV_PIX_FMT_YUV444P16LE:
727 c->chrToYV12 = bswap16UV_c;727 c->chrToYV12 = bswap16UV_c;
728 break;728 break;
729#else729#else
730 case PIX_FMT_YUV444P9BE:730 case AV_PIX_FMT_YUV444P9BE:
731 case PIX_FMT_YUV422P9BE:731 case AV_PIX_FMT_YUV422P9BE:
732 case PIX_FMT_YUV420P9BE:732 case AV_PIX_FMT_YUV420P9BE:
733 case PIX_FMT_YUV444P10BE:733 case AV_PIX_FMT_YUV444P10BE:
734 case PIX_FMT_YUV422P10BE:734 case AV_PIX_FMT_YUV422P10BE:
735 case PIX_FMT_YUV420P10BE:735 case AV_PIX_FMT_YUV420P10BE:
736 case PIX_FMT_YUV420P16BE:736 case AV_PIX_FMT_YUV420P16BE:
737 case PIX_FMT_YUV422P16BE:737 case AV_PIX_FMT_YUV422P16BE:
738 case PIX_FMT_YUV444P16BE:738 case AV_PIX_FMT_YUV444P16BE:
739 c->chrToYV12 = bswap16UV_c;739 c->chrToYV12 = bswap16UV_c;
740 break;740 break;
741#endif741#endif
742 }742 }
743 if (c->chrSrcHSubSample) {743 if (c->chrSrcHSubSample) {
744 switch (srcFormat) {744 switch (srcFormat) {
745 case PIX_FMT_RGB48BE:745 case AV_PIX_FMT_RGB48BE:
746 c->chrToYV12 = rgb48BEToUV_half_c;746 c->chrToYV12 = rgb48BEToUV_half_c;
747 break;747 break;
748 case PIX_FMT_RGB48LE:748 case AV_PIX_FMT_RGB48LE:
749 c->chrToYV12 = rgb48LEToUV_half_c;749 c->chrToYV12 = rgb48LEToUV_half_c;
750 break;750 break;
751 case PIX_FMT_BGR48BE:751 case AV_PIX_FMT_BGR48BE:
752 c->chrToYV12 = bgr48BEToUV_half_c;752 c->chrToYV12 = bgr48BEToUV_half_c;
753 break;753 break;
754 case PIX_FMT_BGR48LE:754 case AV_PIX_FMT_BGR48LE:
755 c->chrToYV12 = bgr48LEToUV_half_c;755 c->chrToYV12 = bgr48LEToUV_half_c;
756 break;756 break;
757 case PIX_FMT_RGB32:757 case AV_PIX_FMT_RGB32:
758 c->chrToYV12 = bgr32ToUV_half_c;758 c->chrToYV12 = bgr32ToUV_half_c;
759 break;759 break;
760 case PIX_FMT_RGB32_1:760 case AV_PIX_FMT_RGB32_1:
761 c->chrToYV12 = bgr321ToUV_half_c;761 c->chrToYV12 = bgr321ToUV_half_c;
762 break;762 break;
763 case PIX_FMT_BGR24:763 case AV_PIX_FMT_BGR24:
764 c->chrToYV12 = bgr24ToUV_half_c;764 c->chrToYV12 = bgr24ToUV_half_c;
765 break;765 break;
766 case PIX_FMT_BGR565LE:766 case AV_PIX_FMT_BGR565LE:
767 c->chrToYV12 = bgr16leToUV_half_c;767 c->chrToYV12 = bgr16leToUV_half_c;
768 break;768 break;
769 case PIX_FMT_BGR565BE:769 case AV_PIX_FMT_BGR565BE:
770 c->chrToYV12 = bgr16beToUV_half_c;770 c->chrToYV12 = bgr16beToUV_half_c;
771 break;771 break;
772 case PIX_FMT_BGR555LE:772 case AV_PIX_FMT_BGR555LE:
773 c->chrToYV12 = bgr15leToUV_half_c;773 c->chrToYV12 = bgr15leToUV_half_c;
774 break;774 break;
775 case PIX_FMT_BGR555BE:775 case AV_PIX_FMT_BGR555BE:
776 c->chrToYV12 = bgr15beToUV_half_c;776 c->chrToYV12 = bgr15beToUV_half_c;
777 break;777 break;
778 case PIX_FMT_BGR444LE:778 case AV_PIX_FMT_BGR444LE:
779 c->chrToYV12 = bgr12leToUV_half_c;779 c->chrToYV12 = bgr12leToUV_half_c;
780 break;780 break;
781 case PIX_FMT_BGR444BE:781 case AV_PIX_FMT_BGR444BE:
782 c->chrToYV12 = bgr12beToUV_half_c;782 c->chrToYV12 = bgr12beToUV_half_c;
783 break;783 break;
784 case PIX_FMT_BGR32:784 case AV_PIX_FMT_BGR32:
785 c->chrToYV12 = rgb32ToUV_half_c;785 c->chrToYV12 = rgb32ToUV_half_c;
786 break;786 break;
787 case PIX_FMT_BGR32_1:787 case AV_PIX_FMT_BGR32_1:
788 c->chrToYV12 = rgb321ToUV_half_c;788 c->chrToYV12 = rgb321ToUV_half_c;
789 break;789 break;
790 case PIX_FMT_RGB24:790 case AV_PIX_FMT_RGB24:
791 c->chrToYV12 = rgb24ToUV_half_c;791 c->chrToYV12 = rgb24ToUV_half_c;
792 break;792 break;
793 case PIX_FMT_RGB565LE:793 case AV_PIX_FMT_RGB565LE:
794 c->chrToYV12 = rgb16leToUV_half_c;794 c->chrToYV12 = rgb16leToUV_half_c;
795 break;795 break;
796 case PIX_FMT_RGB565BE:796 case AV_PIX_FMT_RGB565BE:
797 c->chrToYV12 = rgb16beToUV_half_c;797 c->chrToYV12 = rgb16beToUV_half_c;
798 break;798 break;
799 case PIX_FMT_RGB555LE:799 case AV_PIX_FMT_RGB555LE:
800 c->chrToYV12 = rgb15leToUV_half_c;800 c->chrToYV12 = rgb15leToUV_half_c;
801 break;801 break;
802 case PIX_FMT_RGB555BE:802 case AV_PIX_FMT_RGB555BE:
803 c->chrToYV12 = rgb15beToUV_half_c;803 c->chrToYV12 = rgb15beToUV_half_c;
804 break;804 break;
805 case PIX_FMT_RGB444LE:805 case AV_PIX_FMT_RGB444LE:
806 c->chrToYV12 = rgb12leToUV_half_c;806 c->chrToYV12 = rgb12leToUV_half_c;
807 break;807 break;
808 case PIX_FMT_RGB444BE:808 case AV_PIX_FMT_RGB444BE:
809 c->chrToYV12 = rgb12beToUV_half_c;809 c->chrToYV12 = rgb12beToUV_half_c;
810 break;810 break;
811 }811 }
812 } else {812 } else {
813 switch (srcFormat) {813 switch (srcFormat) {
814 case PIX_FMT_RGB48BE:814 case AV_PIX_FMT_RGB48BE:
815 c->chrToYV12 = rgb48BEToUV_c;815 c->chrToYV12 = rgb48BEToUV_c;
816 break;816 break;
817 case PIX_FMT_RGB48LE:817 case AV_PIX_FMT_RGB48LE:
818 c->chrToYV12 = rgb48LEToUV_c;818 c->chrToYV12 = rgb48LEToUV_c;
819 break;819 break;
820 case PIX_FMT_BGR48BE:820 case AV_PIX_FMT_BGR48BE:
821 c->chrToYV12 = bgr48BEToUV_c;821 c->chrToYV12 = bgr48BEToUV_c;
822 break;822 break;
823 case PIX_FMT_BGR48LE:823 case AV_PIX_FMT_BGR48LE:
824 c->chrToYV12 = bgr48LEToUV_c;824 c->chrToYV12 = bgr48LEToUV_c;
825 break;825 break;
826 case PIX_FMT_RGB32:826 case AV_PIX_FMT_RGB32:
827 c->chrToYV12 = bgr32ToUV_c;827 c->chrToYV12 = bgr32ToUV_c;
828 break;828 break;
829 case PIX_FMT_RGB32_1:829 case AV_PIX_FMT_RGB32_1:
830 c->chrToYV12 = bgr321ToUV_c;830 c->chrToYV12 = bgr321ToUV_c;
831 break;831 break;
832 case PIX_FMT_BGR24:832 case AV_PIX_FMT_BGR24:
833 c->chrToYV12 = bgr24ToUV_c;833 c->chrToYV12 = bgr24ToUV_c;
834 break;834 break;
835 case PIX_FMT_BGR565LE:835 case AV_PIX_FMT_BGR565LE:
836 c->chrToYV12 = bgr16leToUV_c;836 c->chrToYV12 = bgr16leToUV_c;
837 break;837 break;
838 case PIX_FMT_BGR565BE:838 case AV_PIX_FMT_BGR565BE:
839 c->chrToYV12 = bgr16beToUV_c;839 c->chrToYV12 = bgr16beToUV_c;
840 break;840 break;
841 case PIX_FMT_BGR555LE:841 case AV_PIX_FMT_BGR555LE:
842 c->chrToYV12 = bgr15leToUV_c;842 c->chrToYV12 = bgr15leToUV_c;
843 break;843 break;
844 case PIX_FMT_BGR555BE:844 case AV_PIX_FMT_BGR555BE:
845 c->chrToYV12 = bgr15beToUV_c;845 c->chrToYV12 = bgr15beToUV_c;
846 break;846 break;
847 case PIX_FMT_BGR444LE:847 case AV_PIX_FMT_BGR444LE:
848 c->chrToYV12 = bgr12leToUV_c;848 c->chrToYV12 = bgr12leToUV_c;
849 break;849 break;
850 case PIX_FMT_BGR444BE:850 case AV_PIX_FMT_BGR444BE:
851 c->chrToYV12 = bgr12beToUV_c;851 c->chrToYV12 = bgr12beToUV_c;
852 break;852 break;
853 case PIX_FMT_BGR32:853 case AV_PIX_FMT_BGR32:
854 c->chrToYV12 = rgb32ToUV_c;854 c->chrToYV12 = rgb32ToUV_c;
855 break;855 break;
856 case PIX_FMT_BGR32_1:856 case AV_PIX_FMT_BGR32_1:
857 c->chrToYV12 = rgb321ToUV_c;857 c->chrToYV12 = rgb321ToUV_c;
858 break;858 break;
859 case PIX_FMT_RGB24:859 case AV_PIX_FMT_RGB24:
860 c->chrToYV12 = rgb24ToUV_c;860 c->chrToYV12 = rgb24ToUV_c;
861 break;861 break;
862 case PIX_FMT_RGB565LE:862 case AV_PIX_FMT_RGB565LE:
863 c->chrToYV12 = rgb16leToUV_c;863 c->chrToYV12 = rgb16leToUV_c;
864 break;864 break;
865 case PIX_FMT_RGB565BE:865 case AV_PIX_FMT_RGB565BE:
866 c->chrToYV12 = rgb16beToUV_c;866 c->chrToYV12 = rgb16beToUV_c;
867 break;867 break;
868 case PIX_FMT_RGB555LE:868 case AV_PIX_FMT_RGB555LE:
869 c->chrToYV12 = rgb15leToUV_c;869 c->chrToYV12 = rgb15leToUV_c;
870 break;870 break;
871 case PIX_FMT_RGB555BE:871 case AV_PIX_FMT_RGB555BE:
872 c->chrToYV12 = rgb15beToUV_c;872 c->chrToYV12 = rgb15beToUV_c;
873 break;873 break;
874 case PIX_FMT_RGB444LE:874 case AV_PIX_FMT_RGB444LE:
875 c->chrToYV12 = rgb12leToUV_c;875 c->chrToYV12 = rgb12leToUV_c;
876 break;876 break;
877 case PIX_FMT_RGB444BE:877 case AV_PIX_FMT_RGB444BE:
878 c->chrToYV12 = rgb12beToUV_c;878 c->chrToYV12 = rgb12beToUV_c;
879 break;879 break;
880 }880 }
@@ -883,152 +883,152 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) · 2 unmodified lines
883 c->lumToYV12 = NULL;883 c->lumToYV12 = NULL;
884 c->alpToYV12 = NULL;884 c->alpToYV12 = NULL;
885 switch (srcFormat) {885 switch (srcFormat) {
886 case PIX_FMT_GBRP9LE:886 case AV_PIX_FMT_GBRP9LE:
887 c->readLumPlanar = planar_rgb9le_to_y;887 c->readLumPlanar = planar_rgb9le_to_y;
888 break;888 break;
889 case PIX_FMT_GBRP10LE:889 case AV_PIX_FMT_GBRP10LE:
890 c->readLumPlanar = planar_rgb10le_to_y;890 c->readLumPlanar = planar_rgb10le_to_y;
891 break;891 break;
892 case PIX_FMT_GBRP16LE:892 case AV_PIX_FMT_GBRP16LE:
893 c->readLumPlanar = planar_rgb16le_to_y;893 c->readLumPlanar = planar_rgb16le_to_y;
894 break;894 break;
895 case PIX_FMT_GBRP9BE:895 case AV_PIX_FMT_GBRP9BE:
896 c->readLumPlanar = planar_rgb9be_to_y;896 c->readLumPlanar = planar_rgb9be_to_y;
897 break;897 break;
898 case PIX_FMT_GBRP10BE:898 case AV_PIX_FMT_GBRP10BE:
899 c->readLumPlanar = planar_rgb10be_to_y;899 c->readLumPlanar = planar_rgb10be_to_y;
900 break;900 break;
901 case PIX_FMT_GBRP16BE:901 case AV_PIX_FMT_GBRP16BE:
902 c->readLumPlanar = planar_rgb16be_to_y;902 c->readLumPlanar = planar_rgb16be_to_y;
903 break;903 break;
904 case PIX_FMT_GBRP:904 case AV_PIX_FMT_GBRP:
905 c->readLumPlanar = planar_rgb_to_y;905 c->readLumPlanar = planar_rgb_to_y;
906 break;906 break;
907#if HAVE_BIGENDIAN907#if HAVE_BIGENDIAN
908 case PIX_FMT_YUV444P9LE:908 case AV_PIX_FMT_YUV444P9LE:
909 case PIX_FMT_YUV422P9LE:909 case AV_PIX_FMT_YUV422P9LE:
910 case PIX_FMT_YUV420P9LE:910 case AV_PIX_FMT_YUV420P9LE:
911 case PIX_FMT_YUV444P10LE:911 case AV_PIX_FMT_YUV444P10LE:
912 case PIX_FMT_YUV422P10LE:912 case AV_PIX_FMT_YUV422P10LE:
913 case PIX_FMT_YUV420P10LE:913 case AV_PIX_FMT_YUV420P10LE:
914 case PIX_FMT_YUV420P16LE:914 case AV_PIX_FMT_YUV420P16LE:
915 case PIX_FMT_YUV422P16LE:915 case AV_PIX_FMT_YUV422P16LE:
916 case PIX_FMT_YUV444P16LE:916 case AV_PIX_FMT_YUV444P16LE:
917 case PIX_FMT_GRAY16LE:917 case AV_PIX_FMT_GRAY16LE:
918 c->lumToYV12 = bswap16Y_c;918 c->lumToYV12 = bswap16Y_c;
919 break;919 break;
920#else920#else
921 case PIX_FMT_YUV444P9BE:921 case AV_PIX_FMT_YUV444P9BE:
922 case PIX_FMT_YUV422P9BE:922 case AV_PIX_FMT_YUV422P9BE:
923 case PIX_FMT_YUV420P9BE:923 case AV_PIX_FMT_YUV420P9BE:
924 case PIX_FMT_YUV444P10BE:924 case AV_PIX_FMT_YUV444P10BE:
925 case PIX_FMT_YUV422P10BE:925 case AV_PIX_FMT_YUV422P10BE:
926 case PIX_FMT_YUV420P10BE:926 case AV_PIX_FMT_YUV420P10BE:
927 case PIX_FMT_YUV420P16BE:927 case AV_PIX_FMT_YUV420P16BE:
928 case PIX_FMT_YUV422P16BE:928 case AV_PIX_FMT_YUV422P16BE:
929 case PIX_FMT_YUV444P16BE:929 case AV_PIX_FMT_YUV444P16BE:
930 case PIX_FMT_GRAY16BE:930 case AV_PIX_FMT_GRAY16BE:
931 c->lumToYV12 = bswap16Y_c;931 c->lumToYV12 = bswap16Y_c;
932 break;932 break;
933#endif933#endif
934 case PIX_FMT_YUYV422:934 case AV_PIX_FMT_YUYV422:
935 case PIX_FMT_Y400A:935 case AV_PIX_FMT_Y400A:
936 c->lumToYV12 = yuy2ToY_c;936 c->lumToYV12 = yuy2ToY_c;
937 break;937 break;
938 case PIX_FMT_UYVY422:938 case AV_PIX_FMT_UYVY422:
939 c->lumToYV12 = uyvyToY_c;939 c->lumToYV12 = uyvyToY_c;
940 break;940 break;
941 case PIX_FMT_BGR24:941 case AV_PIX_FMT_BGR24:
942 c->lumToYV12 = bgr24ToY_c;942 c->lumToYV12 = bgr24ToY_c;
943 break;943 break;
944 case PIX_FMT_BGR565LE:944 case AV_PIX_FMT_BGR565LE:
945 c->lumToYV12 = bgr16leToY_c;945 c->lumToYV12 = bgr16leToY_c;
946 break;946 break;
947 case PIX_FMT_BGR565BE:947 case AV_PIX_FMT_BGR565BE:
948 c->lumToYV12 = bgr16beToY_c;948 c->lumToYV12 = bgr16beToY_c;
949 break;949 break;
950 case PIX_FMT_BGR555LE:950 case AV_PIX_FMT_BGR555LE:
951 c->lumToYV12 = bgr15leToY_c;951 c->lumToYV12 = bgr15leToY_c;
952 break;952 break;
953 case PIX_FMT_BGR555BE:953 case AV_PIX_FMT_BGR555BE:
954 c->lumToYV12 = bgr15beToY_c;954 c->lumToYV12 = bgr15beToY_c;
955 break;955 break;
956 case PIX_FMT_BGR444LE:956 case AV_PIX_FMT_BGR444LE:
957 c->lumToYV12 = bgr12leToY_c;957 c->lumToYV12 = bgr12leToY_c;
958 break;958 break;
959 case PIX_FMT_BGR444BE:959 case AV_PIX_FMT_BGR444BE:
960 c->lumToYV12 = bgr12beToY_c;960 c->lumToYV12 = bgr12beToY_c;
961 break;961 break;
962 case PIX_FMT_RGB24:962 case AV_PIX_FMT_RGB24:
963 c->lumToYV12 = rgb24ToY_c;963 c->lumToYV12 = rgb24ToY_c;
964 break;964 break;
965 case PIX_FMT_RGB565LE:965 case AV_PIX_FMT_RGB565LE:
966 c->lumToYV12 = rgb16leToY_c;966 c->lumToYV12 = rgb16leToY_c;
967 break;967 break;
968 case PIX_FMT_RGB565BE:968 case AV_PIX_FMT_RGB565BE:
969 c->lumToYV12 = rgb16beToY_c;969 c->lumToYV12 = rgb16beToY_c;
970 break;970 break;
971 case PIX_FMT_RGB555LE:971 case AV_PIX_FMT_RGB555LE:
972 c->lumToYV12 = rgb15leToY_c;972 c->lumToYV12 = rgb15leToY_c;
973 break;973 break;
974 case PIX_FMT_RGB555BE:974 case AV_PIX_FMT_RGB555BE:
975 c->lumToYV12 = rgb15beToY_c;975 c->lumToYV12 = rgb15beToY_c;
976 break;976 break;
977 case PIX_FMT_RGB444LE:977 case AV_PIX_FMT_RGB444LE:
978 c->lumToYV12 = rgb12leToY_c;978 c->lumToYV12 = rgb12leToY_c;
979 break;979 break;
980 case PIX_FMT_RGB444BE:980 case AV_PIX_FMT_RGB444BE:
981 c->lumToYV12 = rgb12beToY_c;981 c->lumToYV12 = rgb12beToY_c;
982 break;982 break;
983 case PIX_FMT_RGB8:983 case AV_PIX_FMT_RGB8:
984 case PIX_FMT_BGR8:984 case AV_PIX_FMT_BGR8:
985 case PIX_FMT_PAL8:985 case AV_PIX_FMT_PAL8:
986 case PIX_FMT_BGR4_BYTE:986 case AV_PIX_FMT_BGR4_BYTE:
987 case PIX_FMT_RGB4_BYTE:987 case AV_PIX_FMT_RGB4_BYTE:
988 c->lumToYV12 = palToY_c;988 c->lumToYV12 = palToY_c;
989 break;989 break;
990 case PIX_FMT_MONOBLACK:990 case AV_PIX_FMT_MONOBLACK:
991 c->lumToYV12 = monoblack2Y_c;991 c->lumToYV12 = monoblack2Y_c;
992 break;992 break;
993 case PIX_FMT_MONOWHITE:993 case AV_PIX_FMT_MONOWHITE:
994 c->lumToYV12 = monowhite2Y_c;994 c->lumToYV12 = monowhite2Y_c;
995 break;995 break;
996 case PIX_FMT_RGB32:996 case AV_PIX_FMT_RGB32:
997 c->lumToYV12 = bgr32ToY_c;997 c->lumToYV12 = bgr32ToY_c;
998 break;998 break;
999 case PIX_FMT_RGB32_1:999 case AV_PIX_FMT_RGB32_1:
1000 c->lumToYV12 = bgr321ToY_c;1000 c->lumToYV12 = bgr321ToY_c;
1001 break;1001 break;
1002 case PIX_FMT_BGR32:1002 case AV_PIX_FMT_BGR32:
1003 c->lumToYV12 = rgb32ToY_c;1003 c->lumToYV12 = rgb32ToY_c;
1004 break;1004 break;
1005 case PIX_FMT_BGR32_1:1005 case AV_PIX_FMT_BGR32_1:
1006 c->lumToYV12 = rgb321ToY_c;1006 c->lumToYV12 = rgb321ToY_c;
1007 break;1007 break;
1008 case PIX_FMT_RGB48BE:1008 case AV_PIX_FMT_RGB48BE:
1009 c->lumToYV12 = rgb48BEToY_c;1009 c->lumToYV12 = rgb48BEToY_c;
1010 break;1010 break;
1011 case PIX_FMT_RGB48LE:1011 case AV_PIX_FMT_RGB48LE:
1012 c->lumToYV12 = rgb48LEToY_c;1012 c->lumToYV12 = rgb48LEToY_c;
1013 break;1013 break;
1014 case PIX_FMT_BGR48BE:1014 case AV_PIX_FMT_BGR48BE:
1015 c->lumToYV12 = bgr48BEToY_c;1015 c->lumToYV12 = bgr48BEToY_c;
1016 break;1016 break;
1017 case PIX_FMT_BGR48LE:1017 case AV_PIX_FMT_BGR48LE:
1018 c->lumToYV12 = bgr48LEToY_c;1018 c->lumToYV12 = bgr48LEToY_c;
1019 break;1019 break;
1020 }1020 }
1021 if (c->alpPixBuf) {1021 if (c->alpPixBuf) {
1022 switch (srcFormat) {1022 switch (srcFormat) {
1023 case PIX_FMT_BGRA:1023 case AV_PIX_FMT_BGRA:
1024 case PIX_FMT_RGBA:1024 case AV_PIX_FMT_RGBA:
1025 c->alpToYV12 = rgbaToA_c;1025 c->alpToYV12 = rgbaToA_c;
1026 break;1026 break;
1027 case PIX_FMT_ABGR:1027 case AV_PIX_FMT_ABGR:
1028 case PIX_FMT_ARGB:1028 case AV_PIX_FMT_ARGB:
1029 c->alpToYV12 = abgrToA_c;1029 c->alpToYV12 = abgrToA_c;
1030 break;1030 break;
1031 case PIX_FMT_Y400A:1031 case AV_PIX_FMT_Y400A:
1032 c->alpToYV12 = uyvyToY_c;1032 c->alpToYV12 = uyvyToY_c;
1033 break;1033 break;
1034 }1034 }
libswscale/options.c+2−2
@@ -56,8 +56,8 @@ static const AVOption options[] = { · 55 unmodified lines
56 { "srch", "source height", OFFSET(srcH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },56 { "srch", "source height", OFFSET(srcH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },
57 { "dstw", "destination width", OFFSET(dstW), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },57 { "dstw", "destination width", OFFSET(dstW), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },
58 { "dsth", "destination height", OFFSET(dstH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },58 { "dsth", "destination height", OFFSET(dstH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE },
59 { "src_format", "source format", OFFSET(srcFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, PIX_FMT_NB - 1, VE },59 { "src_format", "source format", OFFSET(srcFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, AV_PIX_FMT_NB - 1, VE },
60 { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, PIX_FMT_NB - 1, VE },60 { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, AV_PIX_FMT_NB - 1, VE },
61 { "src_range", "source range", OFFSET(srcRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE },61 { "src_range", "source range", OFFSET(srcRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE },
62 { "dst_range", "destination range", OFFSET(dstRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE },62 { "dst_range", "destination range", OFFSET(dstRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE },
63 { "param0", "scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, VE },63 { "param0", "scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, VE },
libswscale/output.c+117−117
@@ -264,11 +264,11 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS · 263 unmodified lines
264 const int16_t **chrUSrc, const int16_t **chrVSrc,264 const int16_t **chrUSrc, const int16_t **chrVSrc,
265 uint8_t *dest, int chrDstW)265 uint8_t *dest, int chrDstW)
266{266{
267 enum PixelFormat dstFormat = c->dstFormat;267 enum AVPixelFormat dstFormat = c->dstFormat;
268 const uint8_t *chrDither = c->chrDither8;268 const uint8_t *chrDither = c->chrDither8;
269 int i;269 int i;
270 270
271 if (dstFormat == PIX_FMT_NV12)271 if (dstFormat == AV_PIX_FMT_NV12)
272 for (i=0; i<chrDstW; i++) {272 for (i=0; i<chrDstW; i++) {
273 int u = chrDither[i & 7] << 12;273 int u = chrDither[i & 7] << 12;
274 int v = chrDither[(i + 3) & 7] << 12;274 int v = chrDither[(i + 3) & 7] << 12;
@@ -300,7 +300,7 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS · 25 unmodified lines
300 acc <<= 1; \300 acc <<= 1; \
301 acc |= (val) >= (128 + 110)301 acc |= (val) >= (128 + 110)
302#define output_pixel(pos, acc) \302#define output_pixel(pos, acc) \
303 if (target == PIX_FMT_MONOBLACK) { \303 if (target == AV_PIX_FMT_MONOBLACK) { \
304 pos = acc; \304 pos = acc; \
305 } else { \305 } else { \
306 pos = ~acc; \306 pos = ~acc; \
@@ -312,7 +312,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, · 5 unmodified lines
312 const int16_t *chrFilter, const int16_t **chrUSrc,312 const int16_t *chrFilter, const int16_t **chrUSrc,
313 const int16_t **chrVSrc, int chrFilterSize,313 const int16_t **chrVSrc, int chrFilterSize,
314 const int16_t **alpSrc, uint8_t *dest, int dstW,314 const int16_t **alpSrc, uint8_t *dest, int dstW,
315 int y, enum PixelFormat target)315 int y, enum AVPixelFormat target)
316{316{
317 const uint8_t * const d128=dither_8x8_220[y&7];317 const uint8_t * const d128=dither_8x8_220[y&7];
318 int i;318 int i;
@@ -350,7 +350,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2], · 31 unmodified lines
350 const int16_t *ubuf[2], const int16_t *vbuf[2],350 const int16_t *ubuf[2], const int16_t *vbuf[2],
351 const int16_t *abuf[2], uint8_t *dest, int dstW,351 const int16_t *abuf[2], uint8_t *dest, int dstW,
352 int yalpha, int uvalpha, int y,352 int yalpha, int uvalpha, int y,
353 enum PixelFormat target)353 enum AVPixelFormat target)
354{354{
355 const int16_t *buf0 = buf[0], *buf1 = buf[1];355 const int16_t *buf0 = buf[0], *buf1 = buf[1];
356 const uint8_t * const d128 = dither_8x8_220[y & 7];356 const uint8_t * const d128 = dither_8x8_220[y & 7];
@@ -385,7 +385,7 @@ static av_always_inline void · 28 unmodified lines
385yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,385yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
386 const int16_t *ubuf[2], const int16_t *vbuf[2],386 const int16_t *ubuf[2], const int16_t *vbuf[2],
387 const int16_t *abuf0, uint8_t *dest, int dstW,387 const int16_t *abuf0, uint8_t *dest, int dstW,
388 int uvalpha, int y, enum PixelFormat target)388 int uvalpha, int y, enum AVPixelFormat target)
389{389{
390 const uint8_t * const d128 = dither_8x8_220[y & 7];390 const uint8_t * const d128 = dither_8x8_220[y & 7];
391 int i;391 int i;
@@ -441,11 +441,11 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \ · 49 unmodified lines
441 y, fmt); \441 y, fmt); \
442}442}
443 443
444YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE)444YUV2PACKEDWRAPPER(yuv2mono,, white, AV_PIX_FMT_MONOWHITE)
445YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK)445YUV2PACKEDWRAPPER(yuv2mono,, black, AV_PIX_FMT_MONOBLACK)
446 446
447#define output_pixels(pos, Y1, U, Y2, V) \447#define output_pixels(pos, Y1, U, Y2, V) \
448 if (target == PIX_FMT_YUYV422) { \448 if (target == AV_PIX_FMT_YUYV422) { \
449 dest[pos + 0] = Y1; \449 dest[pos + 0] = Y1; \
450 dest[pos + 1] = U; \450 dest[pos + 1] = U; \
451 dest[pos + 2] = Y2; \451 dest[pos + 2] = Y2; \
@@ -463,7 +463,7 @@ yuv2422_X_c_template(SwsContext *c, const int16_t *lumFilter, · 11 unmodified lines
463 const int16_t *chrFilter, const int16_t **chrUSrc,463 const int16_t *chrFilter, const int16_t **chrUSrc,
464 const int16_t **chrVSrc, int chrFilterSize,464 const int16_t **chrVSrc, int chrFilterSize,
465 const int16_t **alpSrc, uint8_t *dest, int dstW,465 const int16_t **alpSrc, uint8_t *dest, int dstW,
466 int y, enum PixelFormat target)466 int y, enum AVPixelFormat target)
467{467{
468 int i;468 int i;
469 469
@@ -501,7 +501,7 @@ yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], · 31 unmodified lines
501 const int16_t *ubuf[2], const int16_t *vbuf[2],501 const int16_t *ubuf[2], const int16_t *vbuf[2],
502 const int16_t *abuf[2], uint8_t *dest, int dstW,502 const int16_t *abuf[2], uint8_t *dest, int dstW,
503 int yalpha, int uvalpha, int y,503 int yalpha, int uvalpha, int y,
504 enum PixelFormat target)504 enum AVPixelFormat target)
505{505{
506 const int16_t *buf0 = buf[0], *buf1 = buf[1],506 const int16_t *buf0 = buf[0], *buf1 = buf[1],
507 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],507 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
@@ -529,7 +529,7 @@ static av_always_inline void · 21 unmodified lines
529yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,529yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
530 const int16_t *ubuf[2], const int16_t *vbuf[2],530 const int16_t *ubuf[2], const int16_t *vbuf[2],
531 const int16_t *abuf0, uint8_t *dest, int dstW,531 const int16_t *abuf0, uint8_t *dest, int dstW,
532 int uvalpha, int y, enum PixelFormat target)532 int uvalpha, int y, enum AVPixelFormat target)
533{533{
534 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];534 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
535 int i;535 int i;
@@ -568,11 +568,11 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, · 32 unmodified lines
568 568
569#undef output_pixels569#undef output_pixels
570 570
571YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422)571YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422)
572YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422)572YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422)
573 573
574#define R_B ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? R : B)574#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? R : B)
575#define B_R ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? B : R)575#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? B : R)
576#define output_pixel(pos, val) \576#define output_pixel(pos, val) \
577 if (isBE(target)) { \577 if (isBE(target)) { \
578 AV_WB16(pos, val); \578 AV_WB16(pos, val); \
@@ -586,7 +586,7 @@ yuv2rgb48_X_c_template(SwsContext *c, const int16_t *lumFilter, · 7 unmodified lines
586 const int16_t *chrFilter, const int32_t **chrUSrc,586 const int16_t *chrFilter, const int32_t **chrUSrc,
587 const int32_t **chrVSrc, int chrFilterSize,587 const int32_t **chrVSrc, int chrFilterSize,
588 const int32_t **alpSrc, uint16_t *dest, int dstW,588 const int32_t **alpSrc, uint16_t *dest, int dstW,
589 int y, enum PixelFormat target)589 int y, enum AVPixelFormat target)
590{590{
591 int i;591 int i;
592 592
@@ -644,7 +644,7 @@ yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2], · 51 unmodified lines
644 const int32_t *ubuf[2], const int32_t *vbuf[2],644 const int32_t *ubuf[2], const int32_t *vbuf[2],
645 const int32_t *abuf[2], uint16_t *dest, int dstW,645 const int32_t *abuf[2], uint16_t *dest, int dstW,
646 int yalpha, int uvalpha, int y,646 int yalpha, int uvalpha, int y,
647 enum PixelFormat target)647 enum AVPixelFormat target)
648{648{
649 const int32_t *buf0 = buf[0], *buf1 = buf[1],649 const int32_t *buf0 = buf[0], *buf1 = buf[1],
650 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],650 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
@@ -685,7 +685,7 @@ static av_always_inline void · 34 unmodified lines
685yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0,685yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0,
686 const int32_t *ubuf[2], const int32_t *vbuf[2],686 const int32_t *ubuf[2], const int32_t *vbuf[2],
687 const int32_t *abuf0, uint16_t *dest, int dstW,687 const int32_t *abuf0, uint16_t *dest, int dstW,
688 int uvalpha, int y, enum PixelFormat target)688 int uvalpha, int y, enum AVPixelFormat target)
689{689{
690 const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];690 const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
691 int i;691 int i;
@@ -798,10 +798,10 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \ · 106 unmodified lines
798 dstW, uvalpha, y, fmt); \798 dstW, uvalpha, y, fmt); \
799}799}
800 800
801YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE)801YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, AV_PIX_FMT_RGB48BE)
802YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE)802YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, AV_PIX_FMT_RGB48LE)
803YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)803YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, AV_PIX_FMT_BGR48BE)
804YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)804YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, AV_PIX_FMT_BGR48LE)
805 805
806/*806/*
807 * Write out 2 RGB pixels in the target pixel format. This function takes a807 * Write out 2 RGB pixels in the target pixel format. This function takes a
@@ -815,23 +815,23 @@ static av_always_inline void · 7 unmodified lines
815yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2,815yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2,
816 unsigned A1, unsigned A2,816 unsigned A1, unsigned A2,
817 const void *_r, const void *_g, const void *_b, int y,817 const void *_r, const void *_g, const void *_b, int y,
818 enum PixelFormat target, int hasAlpha)818 enum AVPixelFormat target, int hasAlpha)
819{819{
820 if (target == PIX_FMT_ARGB || target == PIX_FMT_RGBA ||820 if (target == AV_PIX_FMT_ARGB || target == AV_PIX_FMT_RGBA ||
821 target == PIX_FMT_ABGR || target == PIX_FMT_BGRA) {821 target == AV_PIX_FMT_ABGR || target == AV_PIX_FMT_BGRA) {
822 uint32_t *dest = (uint32_t *) _dest;822 uint32_t *dest = (uint32_t *) _dest;
823 const uint32_t *r = (const uint32_t *) _r;823 const uint32_t *r = (const uint32_t *) _r;
824 const uint32_t *g = (const uint32_t *) _g;824 const uint32_t *g = (const uint32_t *) _g;
825 const uint32_t *b = (const uint32_t *) _b;825 const uint32_t *b = (const uint32_t *) _b;
826 826
827#if CONFIG_SMALL827#if CONFIG_SMALL
828 int sh = hasAlpha ? ((target == PIX_FMT_RGB32_1 || target == PIX_FMT_BGR32_1) ? 0 : 24) : 0;828 int sh = hasAlpha ? ((target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24) : 0;
829 829
830 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (hasAlpha ? A1 << sh : 0);830 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (hasAlpha ? A1 << sh : 0);
831 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (hasAlpha ? A2 << sh : 0);831 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (hasAlpha ? A2 << sh : 0);
832#else832#else
833 if (hasAlpha) {833 if (hasAlpha) {
834 int sh = (target == PIX_FMT_RGB32_1 || target == PIX_FMT_BGR32_1) ? 0 : 24;834 int sh = (target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24;
835 835
836 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh);836 dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh);
837 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh);837 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh);
@@ -840,14 +840,14 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2, · 2 unmodified lines
840 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2];840 dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2];
841 }841 }
842#endif842#endif
843 } else if (target == PIX_FMT_RGB24 || target == PIX_FMT_BGR24) {843 } else if (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) {
844 uint8_t *dest = (uint8_t *) _dest;844 uint8_t *dest = (uint8_t *) _dest;
845 const uint8_t *r = (const uint8_t *) _r;845 const uint8_t *r = (const uint8_t *) _r;
846 const uint8_t *g = (const uint8_t *) _g;846 const uint8_t *g = (const uint8_t *) _g;
847 const uint8_t *b = (const uint8_t *) _b;847 const uint8_t *b = (const uint8_t *) _b;
848 848
849#define r_b ((target == PIX_FMT_RGB24) ? r : b)849#define r_b ((target == AV_PIX_FMT_RGB24) ? r : b)
850#define b_r ((target == PIX_FMT_RGB24) ? b : r)850#define b_r ((target == AV_PIX_FMT_RGB24) ? b : r)
851 dest[i * 6 + 0] = r_b[Y1];851 dest[i * 6 + 0] = r_b[Y1];
852 dest[i * 6 + 1] = g[Y1];852 dest[i * 6 + 1] = g[Y1];
853 dest[i * 6 + 2] = b_r[Y1];853 dest[i * 6 + 2] = b_r[Y1];
@@ -856,23 +856,23 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2, · 2 unmodified lines
856 dest[i * 6 + 5] = b_r[Y2];856 dest[i * 6 + 5] = b_r[Y2];
857#undef r_b857#undef r_b
858#undef b_r858#undef b_r
859 } else if (target == PIX_FMT_RGB565 || target == PIX_FMT_BGR565 ||859 } else if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565 ||
860 target == PIX_FMT_RGB555 || target == PIX_FMT_BGR555 ||860 target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555 ||
861 target == PIX_FMT_RGB444 || target == PIX_FMT_BGR444) {861 target == AV_PIX_FMT_RGB444 || target == AV_PIX_FMT_BGR444) {
862 uint16_t *dest = (uint16_t *) _dest;862 uint16_t *dest = (uint16_t *) _dest;
863 const uint16_t *r = (const uint16_t *) _r;863 const uint16_t *r = (const uint16_t *) _r;
864 const uint16_t *g = (const uint16_t *) _g;864 const uint16_t *g = (const uint16_t *) _g;
865 const uint16_t *b = (const uint16_t *) _b;865 const uint16_t *b = (const uint16_t *) _b;
866 int dr1, dg1, db1, dr2, dg2, db2;866 int dr1, dg1, db1, dr2, dg2, db2;
867 867
868 if (target == PIX_FMT_RGB565 || target == PIX_FMT_BGR565) {868 if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565) {
869 dr1 = dither_2x2_8[ y & 1 ][0];869 dr1 = dither_2x2_8[ y & 1 ][0];
870 dg1 = dither_2x2_4[ y & 1 ][0];870 dg1 = dither_2x2_4[ y & 1 ][0];
871 db1 = dither_2x2_8[(y & 1) ^ 1][0];871 db1 = dither_2x2_8[(y & 1) ^ 1][0];
872 dr2 = dither_2x2_8[ y & 1 ][1];872 dr2 = dither_2x2_8[ y & 1 ][1];
873 dg2 = dither_2x2_4[ y & 1 ][1];873 dg2 = dither_2x2_4[ y & 1 ][1];
874 db2 = dither_2x2_8[(y & 1) ^ 1][1];874 db2 = dither_2x2_8[(y & 1) ^ 1][1];
875 } else if (target == PIX_FMT_RGB555 || target == PIX_FMT_BGR555) {875 } else if (target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555) {
876 dr1 = dither_2x2_8[ y & 1 ][0];876 dr1 = dither_2x2_8[ y & 1 ][0];
877 dg1 = dither_2x2_8[ y & 1 ][1];877 dg1 = dither_2x2_8[ y & 1 ][1];
878 db1 = dither_2x2_8[(y & 1) ^ 1][0];878 db1 = dither_2x2_8[(y & 1) ^ 1][0];
@@ -897,7 +897,7 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2, · 18 unmodified lines
897 const uint8_t *b = (const uint8_t *) _b;897 const uint8_t *b = (const uint8_t *) _b;
898 int dr1, dg1, db1, dr2, dg2, db2;898 int dr1, dg1, db1, dr2, dg2, db2;
899 899
900 if (target == PIX_FMT_RGB8 || target == PIX_FMT_BGR8) {900 if (target == AV_PIX_FMT_RGB8 || target == AV_PIX_FMT_BGR8) {
901 const uint8_t * const d64 = dither_8x8_73[y & 7];901 const uint8_t * const d64 = dither_8x8_73[y & 7];
902 const uint8_t * const d32 = dither_8x8_32[y & 7];902 const uint8_t * const d32 = dither_8x8_32[y & 7];
903 dr1 = dg1 = d32[(i * 2 + 0) & 7];903 dr1 = dg1 = d32[(i * 2 + 0) & 7];
@@ -913,7 +913,7 @@ yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned Y2, · 9 unmodified lines
913 dg2 = d64[(i * 2 + 1) & 7];913 dg2 = d64[(i * 2 + 1) & 7];
914 }914 }
915 915
916 if (target == PIX_FMT_RGB4 || target == PIX_FMT_BGR4) {916 if (target == AV_PIX_FMT_RGB4 || target == AV_PIX_FMT_BGR4) {
917 dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] +917 dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] +
918 ((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4);918 ((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4);
919 } else {919 } else {
@@ -929,7 +929,7 @@ yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter, · 9 unmodified lines
929 const int16_t *chrFilter, const int16_t **chrUSrc,929 const int16_t *chrFilter, const int16_t **chrUSrc,
930 const int16_t **chrVSrc, int chrFilterSize,930 const int16_t **chrVSrc, int chrFilterSize,
931 const int16_t **alpSrc, uint8_t *dest, int dstW,931 const int16_t **alpSrc, uint8_t *dest, int dstW,
932 int y, enum PixelFormat target, int hasAlpha)932 int y, enum AVPixelFormat target, int hasAlpha)
933{933{
934 int i;934 int i;
935 935
@@ -989,7 +989,7 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2], · 53 unmodified lines
989 const int16_t *ubuf[2], const int16_t *vbuf[2],989 const int16_t *ubuf[2], const int16_t *vbuf[2],
990 const int16_t *abuf[2], uint8_t *dest, int dstW,990 const int16_t *abuf[2], uint8_t *dest, int dstW,
991 int yalpha, int uvalpha, int y,991 int yalpha, int uvalpha, int y,
992 enum PixelFormat target, int hasAlpha)992 enum AVPixelFormat target, int hasAlpha)
993{993{
994 const int16_t *buf0 = buf[0], *buf1 = buf[1],994 const int16_t *buf0 = buf[0], *buf1 = buf[1],
995 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],995 *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
@@ -1033,7 +1033,7 @@ static av_always_inline void · 37 unmodified lines
1033yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,1033yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
1034 const int16_t *ubuf[2], const int16_t *vbuf[2],1034 const int16_t *ubuf[2], const int16_t *vbuf[2],
1035 const int16_t *abuf0, uint8_t *dest, int dstW,1035 const int16_t *abuf0, uint8_t *dest, int dstW,
1036 int uvalpha, int y, enum PixelFormat target,1036 int uvalpha, int y, enum AVPixelFormat target,
1037 int hasAlpha)1037 int hasAlpha)
1038{1038{
1039 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];1039 const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
@@ -1132,24 +1132,24 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \ · 92 unmodified lines
1132}1132}
1133 1133
1134#if CONFIG_SMALL1134#if CONFIG_SMALL
1135YUV2RGBWRAPPER(yuv2rgb,, 32_1, PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)1135YUV2RGBWRAPPER(yuv2rgb,, 32_1, AV_PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1136YUV2RGBWRAPPER(yuv2rgb,, 32, PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)1136YUV2RGBWRAPPER(yuv2rgb,, 32, AV_PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1137#else1137#else
1138#if CONFIG_SWSCALE_ALPHA1138#if CONFIG_SWSCALE_ALPHA
1139YUV2RGBWRAPPER(yuv2rgb,, a32_1, PIX_FMT_RGB32_1, 1)1139YUV2RGBWRAPPER(yuv2rgb,, a32_1, AV_PIX_FMT_RGB32_1, 1)
1140YUV2RGBWRAPPER(yuv2rgb,, a32, PIX_FMT_RGB32, 1)1140YUV2RGBWRAPPER(yuv2rgb,, a32, AV_PIX_FMT_RGB32, 1)
1141#endif1141#endif
1142YUV2RGBWRAPPER(yuv2rgb,, x32_1, PIX_FMT_RGB32_1, 0)1142YUV2RGBWRAPPER(yuv2rgb,, x32_1, AV_PIX_FMT_RGB32_1, 0)
1143YUV2RGBWRAPPER(yuv2rgb,, x32, PIX_FMT_RGB32, 0)1143YUV2RGBWRAPPER(yuv2rgb,, x32, AV_PIX_FMT_RGB32, 0)
1144#endif1144#endif
1145YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24, 0)1145YUV2RGBWRAPPER(yuv2, rgb, rgb24, AV_PIX_FMT_RGB24, 0)
1146YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24, 0)1146YUV2RGBWRAPPER(yuv2, rgb, bgr24, AV_PIX_FMT_BGR24, 0)
1147YUV2RGBWRAPPER(yuv2rgb,, 16, PIX_FMT_RGB565, 0)1147YUV2RGBWRAPPER(yuv2rgb,, 16, AV_PIX_FMT_RGB565, 0)
1148YUV2RGBWRAPPER(yuv2rgb,, 15, PIX_FMT_RGB555, 0)1148YUV2RGBWRAPPER(yuv2rgb,, 15, AV_PIX_FMT_RGB555, 0)
1149YUV2RGBWRAPPER(yuv2rgb,, 12, PIX_FMT_RGB444, 0)1149YUV2RGBWRAPPER(yuv2rgb,, 12, AV_PIX_FMT_RGB444, 0)
1150YUV2RGBWRAPPER(yuv2rgb,, 8, PIX_FMT_RGB8, 0)1150YUV2RGBWRAPPER(yuv2rgb,, 8, AV_PIX_FMT_RGB8, 0)
1151YUV2RGBWRAPPER(yuv2rgb,, 4, PIX_FMT_RGB4, 0)1151YUV2RGBWRAPPER(yuv2rgb,, 4, AV_PIX_FMT_RGB4, 0)
1152YUV2RGBWRAPPER(yuv2rgb,, 4b, PIX_FMT_RGB4_BYTE, 0)1152YUV2RGBWRAPPER(yuv2rgb,, 4b, AV_PIX_FMT_RGB4_BYTE, 0)
1153 1153
1154static av_always_inline void1154static av_always_inline void
1155yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,1155yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
@@ -1157,10 +1157,10 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, · 1 unmodified line
1157 const int16_t *chrFilter, const int16_t **chrUSrc,1157 const int16_t *chrFilter, const int16_t **chrUSrc,
1158 const int16_t **chrVSrc, int chrFilterSize,1158 const int16_t **chrVSrc, int chrFilterSize,
1159 const int16_t **alpSrc, uint8_t *dest,1159 const int16_t **alpSrc, uint8_t *dest,
1160 int dstW, int y, enum PixelFormat target, int hasAlpha)1160 int dstW, int y, enum AVPixelFormat target, int hasAlpha)
1161{1161{
1162 int i;1162 int i;
1163 int step = (target == PIX_FMT_RGB24 || target == PIX_FMT_BGR24) ? 3 : 4;1163 int step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4;
1164 1164
1165 for (i = 0; i < dstW; i++) {1165 for (i = 0; i < dstW; i++) {
1166 int j;1166 int j;
@@ -1201,36 +1201,36 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, · 34 unmodified lines
1201 }1201 }
1202 1202
1203 switch(target) {1203 switch(target) {
1204 case PIX_FMT_ARGB:1204 case AV_PIX_FMT_ARGB:
1205 dest[0] = hasAlpha ? A : 255;1205 dest[0] = hasAlpha ? A : 255;
1206 dest[1] = R >> 22;1206 dest[1] = R >> 22;
1207 dest[2] = G >> 22;1207 dest[2] = G >> 22;
1208 dest[3] = B >> 22;1208 dest[3] = B >> 22;
1209 break;1209 break;
1210 case PIX_FMT_RGB24:1210 case AV_PIX_FMT_RGB24:
1211 dest[0] = R >> 22;1211 dest[0] = R >> 22;
1212 dest[1] = G >> 22;1212 dest[1] = G >> 22;
1213 dest[2] = B >> 22;1213 dest[2] = B >> 22;
1214 break;1214 break;
1215 case PIX_FMT_RGBA:1215 case AV_PIX_FMT_RGBA:
1216 dest[0] = R >> 22;1216 dest[0] = R >> 22;
1217 dest[1] = G >> 22;1217 dest[1] = G >> 22;
1218 dest[2] = B >> 22;1218 dest[2] = B >> 22;
1219 dest[3] = hasAlpha ? A : 255;1219 dest[3] = hasAlpha ? A : 255;
1220 break;1220 break;
1221 case PIX_FMT_ABGR:1221 case AV_PIX_FMT_ABGR:
1222 dest[0] = hasAlpha ? A : 255;1222 dest[0] = hasAlpha ? A : 255;
1223 dest[1] = B >> 22;1223 dest[1] = B >> 22;
1224 dest[2] = G >> 22;1224 dest[2] = G >> 22;
1225 dest[3] = R >> 22;1225 dest[3] = R >> 22;
1226 dest += 4;1226 dest += 4;
1227 break;1227 break;
1228 case PIX_FMT_BGR24:1228 case AV_PIX_FMT_BGR24:
1229 dest[0] = B >> 22;1229 dest[0] = B >> 22;
1230 dest[1] = G >> 22;1230 dest[1] = G >> 22;
1231 dest[2] = R >> 22;1231 dest[2] = R >> 22;
1232 break;1232 break;
1233 case PIX_FMT_BGRA:1233 case AV_PIX_FMT_BGRA:
1234 dest[0] = B >> 22;1234 dest[0] = B >> 22;
1235 dest[1] = G >> 22;1235 dest[1] = G >> 22;
1236 dest[2] = R >> 22;1236 dest[2] = R >> 22;
@@ -1242,24 +1242,24 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, · 5 unmodified lines
1242}1242}
1243 1243
1244#if CONFIG_SMALL1244#if CONFIG_SMALL
1245YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)1245YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1246YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)1246YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1247YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)1247YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1248YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)1248YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1249#else1249#else
1250#if CONFIG_SWSCALE_ALPHA1250#if CONFIG_SWSCALE_ALPHA
1251YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, 1)1251YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, 1)
1252YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, 1)1252YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, 1)
1253YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, 1)1253YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, 1)
1254YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, 1)1254YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, 1)
1255#endif1255#endif
1256YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA, 0)1256YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, AV_PIX_FMT_BGRA, 0)
1257YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR, 0)1257YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, AV_PIX_FMT_ABGR, 0)
1258YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA, 0)1258YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, AV_PIX_FMT_RGBA, 0)
1259YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB, 0)1259YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, AV_PIX_FMT_ARGB, 0)
1260#endif1260#endif
1261YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, PIX_FMT_BGR24, 0)1261YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, AV_PIX_FMT_BGR24, 0)
1262YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, PIX_FMT_RGB24, 0)1262YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, AV_PIX_FMT_RGB24, 0)
1263 1263
1264av_cold void ff_sws_init_output_funcs(SwsContext *c,1264av_cold void ff_sws_init_output_funcs(SwsContext *c,
1265 yuv2planar1_fn *yuv2plane1,1265 yuv2planar1_fn *yuv2plane1,
@@ -1269,7 +1269,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 3 unmodified lines
1269 yuv2packed2_fn *yuv2packed2,1269 yuv2packed2_fn *yuv2packed2,
1270 yuv2packedX_fn *yuv2packedX)1270 yuv2packedX_fn *yuv2packedX)
1271{1271{
1272 enum PixelFormat dstFormat = c->dstFormat;1272 enum AVPixelFormat dstFormat = c->dstFormat;
1273 1273
1274 if (is16BPS(dstFormat)) {1274 if (is16BPS(dstFormat)) {
1275 *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;1275 *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c;
@@ -1285,13 +1285,13 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 9 unmodified lines
1285 } else {1285 } else {
1286 *yuv2plane1 = yuv2plane1_8_c;1286 *yuv2plane1 = yuv2plane1_8_c;
1287 *yuv2planeX = yuv2planeX_8_c;1287 *yuv2planeX = yuv2planeX_8_c;
1288 if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)1288 if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)
1289 *yuv2nv12cX = yuv2nv12cX_c;1289 *yuv2nv12cX = yuv2nv12cX_c;
1290 }1290 }
1291 1291
1292 if(c->flags & SWS_FULL_CHR_H_INT) {1292 if(c->flags & SWS_FULL_CHR_H_INT) {
1293 switch (dstFormat) {1293 switch (dstFormat) {
1294 case PIX_FMT_RGBA:1294 case AV_PIX_FMT_RGBA:
1295#if CONFIG_SMALL1295#if CONFIG_SMALL
1296 *yuv2packedX = yuv2rgba32_full_X_c;1296 *yuv2packedX = yuv2rgba32_full_X_c;
1297#else1297#else
@@ -1305,7 +1305,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 7 unmodified lines
1305 }1305 }
1306#endif /* !CONFIG_SMALL */1306#endif /* !CONFIG_SMALL */
1307 break;1307 break;
1308 case PIX_FMT_ARGB:1308 case AV_PIX_FMT_ARGB:
1309#if CONFIG_SMALL1309#if CONFIG_SMALL
1310 *yuv2packedX = yuv2argb32_full_X_c;1310 *yuv2packedX = yuv2argb32_full_X_c;
1311#else1311#else
@@ -1319,7 +1319,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 7 unmodified lines
1319 }1319 }
1320#endif /* !CONFIG_SMALL */1320#endif /* !CONFIG_SMALL */
1321 break;1321 break;
1322 case PIX_FMT_BGRA:1322 case AV_PIX_FMT_BGRA:
1323#if CONFIG_SMALL1323#if CONFIG_SMALL
1324 *yuv2packedX = yuv2bgra32_full_X_c;1324 *yuv2packedX = yuv2bgra32_full_X_c;
1325#else1325#else
@@ -1333,7 +1333,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 7 unmodified lines
1333 }1333 }
1334#endif /* !CONFIG_SMALL */1334#endif /* !CONFIG_SMALL */
1335 break;1335 break;
1336 case PIX_FMT_ABGR:1336 case AV_PIX_FMT_ABGR:
1337#if CONFIG_SMALL1337#if CONFIG_SMALL
1338 *yuv2packedX = yuv2abgr32_full_X_c;1338 *yuv2packedX = yuv2abgr32_full_X_c;
1339#else1339#else
@@ -1347,37 +1347,37 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 7 unmodified lines
1347 }1347 }
1348#endif /* !CONFIG_SMALL */1348#endif /* !CONFIG_SMALL */
1349 break;1349 break;
1350 case PIX_FMT_RGB24:1350 case AV_PIX_FMT_RGB24:
1351 *yuv2packedX = yuv2rgb24_full_X_c;1351 *yuv2packedX = yuv2rgb24_full_X_c;
1352 break;1352 break;
1353 case PIX_FMT_BGR24:1353 case AV_PIX_FMT_BGR24:
1354 *yuv2packedX = yuv2bgr24_full_X_c;1354 *yuv2packedX = yuv2bgr24_full_X_c;
1355 break;1355 break;
1356 }1356 }
1357 } else {1357 } else {
1358 switch (dstFormat) {1358 switch (dstFormat) {
1359 case PIX_FMT_RGB48LE:1359 case AV_PIX_FMT_RGB48LE:
1360 *yuv2packed1 = yuv2rgb48le_1_c;1360 *yuv2packed1 = yuv2rgb48le_1_c;
1361 *yuv2packed2 = yuv2rgb48le_2_c;1361 *yuv2packed2 = yuv2rgb48le_2_c;
1362 *yuv2packedX = yuv2rgb48le_X_c;1362 *yuv2packedX = yuv2rgb48le_X_c;
1363 break;1363 break;
1364 case PIX_FMT_RGB48BE:1364 case AV_PIX_FMT_RGB48BE:
1365 *yuv2packed1 = yuv2rgb48be_1_c;1365 *yuv2packed1 = yuv2rgb48be_1_c;
1366 *yuv2packed2 = yuv2rgb48be_2_c;1366 *yuv2packed2 = yuv2rgb48be_2_c;
1367 *yuv2packedX = yuv2rgb48be_X_c;1367 *yuv2packedX = yuv2rgb48be_X_c;
1368 break;1368 break;
1369 case PIX_FMT_BGR48LE:1369 case AV_PIX_FMT_BGR48LE:
1370 *yuv2packed1 = yuv2bgr48le_1_c;1370 *yuv2packed1 = yuv2bgr48le_1_c;
1371 *yuv2packed2 = yuv2bgr48le_2_c;1371 *yuv2packed2 = yuv2bgr48le_2_c;
1372 *yuv2packedX = yuv2bgr48le_X_c;1372 *yuv2packedX = yuv2bgr48le_X_c;
1373 break;1373 break;
1374 case PIX_FMT_BGR48BE:1374 case AV_PIX_FMT_BGR48BE:
1375 *yuv2packed1 = yuv2bgr48be_1_c;1375 *yuv2packed1 = yuv2bgr48be_1_c;
1376 *yuv2packed2 = yuv2bgr48be_2_c;1376 *yuv2packed2 = yuv2bgr48be_2_c;
1377 *yuv2packedX = yuv2bgr48be_X_c;1377 *yuv2packedX = yuv2bgr48be_X_c;
1378 break;1378 break;
1379 case PIX_FMT_RGB32:1379 case AV_PIX_FMT_RGB32:
1380 case PIX_FMT_BGR32:1380 case AV_PIX_FMT_BGR32:
1381#if CONFIG_SMALL1381#if CONFIG_SMALL
1382 *yuv2packed1 = yuv2rgb32_1_c;1382 *yuv2packed1 = yuv2rgb32_1_c;
1383 *yuv2packed2 = yuv2rgb32_2_c;1383 *yuv2packed2 = yuv2rgb32_2_c;
@@ -1397,8 +1397,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 13 unmodified lines
1397 }1397 }
1398#endif /* !CONFIG_SMALL */1398#endif /* !CONFIG_SMALL */
1399 break;1399 break;
1400 case PIX_FMT_RGB32_1:1400 case AV_PIX_FMT_RGB32_1:
1401 case PIX_FMT_BGR32_1:1401 case AV_PIX_FMT_BGR32_1:
1402#if CONFIG_SMALL1402#if CONFIG_SMALL
1403 *yuv2packed1 = yuv2rgb32_1_1_c;1403 *yuv2packed1 = yuv2rgb32_1_1_c;
1404 *yuv2packed2 = yuv2rgb32_1_2_c;1404 *yuv2packed2 = yuv2rgb32_1_2_c;
@@ -1418,54 +1418,54 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 13 unmodified lines
1418 }1418 }
1419#endif /* !CONFIG_SMALL */1419#endif /* !CONFIG_SMALL */
1420 break;1420 break;
1421 case PIX_FMT_RGB24:1421 case AV_PIX_FMT_RGB24:
1422 *yuv2packed1 = yuv2rgb24_1_c;1422 *yuv2packed1 = yuv2rgb24_1_c;
1423 *yuv2packed2 = yuv2rgb24_2_c;1423 *yuv2packed2 = yuv2rgb24_2_c;
1424 *yuv2packedX = yuv2rgb24_X_c;1424 *yuv2packedX = yuv2rgb24_X_c;
1425 break;1425 break;
1426 case PIX_FMT_BGR24:1426 case AV_PIX_FMT_BGR24:
1427 *yuv2packed1 = yuv2bgr24_1_c;1427 *yuv2packed1 = yuv2bgr24_1_c;
1428 *yuv2packed2 = yuv2bgr24_2_c;1428 *yuv2packed2 = yuv2bgr24_2_c;
1429 *yuv2packedX = yuv2bgr24_X_c;1429 *yuv2packedX = yuv2bgr24_X_c;
1430 break;1430 break;
1431 case PIX_FMT_RGB565LE:1431 case AV_PIX_FMT_RGB565LE:
1432 case PIX_FMT_RGB565BE:1432 case AV_PIX_FMT_RGB565BE:
1433 case PIX_FMT_BGR565LE:1433 case AV_PIX_FMT_BGR565LE:
1434 case PIX_FMT_BGR565BE:1434 case AV_PIX_FMT_BGR565BE:
1435 *yuv2packed1 = yuv2rgb16_1_c;1435 *yuv2packed1 = yuv2rgb16_1_c;
1436 *yuv2packed2 = yuv2rgb16_2_c;1436 *yuv2packed2 = yuv2rgb16_2_c;
1437 *yuv2packedX = yuv2rgb16_X_c;1437 *yuv2packedX = yuv2rgb16_X_c;
1438 break;1438 break;
1439 case PIX_FMT_RGB555LE:1439 case AV_PIX_FMT_RGB555LE:
1440 case PIX_FMT_RGB555BE:1440 case AV_PIX_FMT_RGB555BE:
1441 case PIX_FMT_BGR555LE:1441 case AV_PIX_FMT_BGR555LE:
1442 case PIX_FMT_BGR555BE:1442 case AV_PIX_FMT_BGR555BE:
1443 *yuv2packed1 = yuv2rgb15_1_c;1443 *yuv2packed1 = yuv2rgb15_1_c;
1444 *yuv2packed2 = yuv2rgb15_2_c;1444 *yuv2packed2 = yuv2rgb15_2_c;
1445 *yuv2packedX = yuv2rgb15_X_c;1445 *yuv2packedX = yuv2rgb15_X_c;
1446 break;1446 break;
1447 case PIX_FMT_RGB444LE:1447 case AV_PIX_FMT_RGB444LE:
1448 case PIX_FMT_RGB444BE:1448 case AV_PIX_FMT_RGB444BE:
1449 case PIX_FMT_BGR444LE:1449 case AV_PIX_FMT_BGR444LE:
1450 case PIX_FMT_BGR444BE:1450 case AV_PIX_FMT_BGR444BE:
1451 *yuv2packed1 = yuv2rgb12_1_c;1451 *yuv2packed1 = yuv2rgb12_1_c;
1452 *yuv2packed2 = yuv2rgb12_2_c;1452 *yuv2packed2 = yuv2rgb12_2_c;
1453 *yuv2packedX = yuv2rgb12_X_c;1453 *yuv2packedX = yuv2rgb12_X_c;
1454 break;1454 break;
1455 case PIX_FMT_RGB8:1455 case AV_PIX_FMT_RGB8:
1456 case PIX_FMT_BGR8:1456 case AV_PIX_FMT_BGR8:
1457 *yuv2packed1 = yuv2rgb8_1_c;1457 *yuv2packed1 = yuv2rgb8_1_c;
1458 *yuv2packed2 = yuv2rgb8_2_c;1458 *yuv2packed2 = yuv2rgb8_2_c;
1459 *yuv2packedX = yuv2rgb8_X_c;1459 *yuv2packedX = yuv2rgb8_X_c;
1460 break;1460 break;
1461 case PIX_FMT_RGB4:1461 case AV_PIX_FMT_RGB4:
1462 case PIX_FMT_BGR4:1462 case AV_PIX_FMT_BGR4:
1463 *yuv2packed1 = yuv2rgb4_1_c;1463 *yuv2packed1 = yuv2rgb4_1_c;
1464 *yuv2packed2 = yuv2rgb4_2_c;1464 *yuv2packed2 = yuv2rgb4_2_c;
1465 *yuv2packedX = yuv2rgb4_X_c;1465 *yuv2packedX = yuv2rgb4_X_c;
1466 break;1466 break;
1467 case PIX_FMT_RGB4_BYTE:1467 case AV_PIX_FMT_RGB4_BYTE:
1468 case PIX_FMT_BGR4_BYTE:1468 case AV_PIX_FMT_BGR4_BYTE:
1469 *yuv2packed1 = yuv2rgb4b_1_c;1469 *yuv2packed1 = yuv2rgb4b_1_c;
1470 *yuv2packed2 = yuv2rgb4b_2_c;1470 *yuv2packed2 = yuv2rgb4b_2_c;
1471 *yuv2packedX = yuv2rgb4b_X_c;1471 *yuv2packedX = yuv2rgb4b_X_c;
@@ -1473,22 +1473,22 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, · 1 unmodified line
1473 }1473 }
1474 }1474 }
1475 switch (dstFormat) {1475 switch (dstFormat) {
1476 case PIX_FMT_MONOWHITE:1476 case AV_PIX_FMT_MONOWHITE:
1477 *yuv2packed1 = yuv2monowhite_1_c;1477 *yuv2packed1 = yuv2monowhite_1_c;
1478 *yuv2packed2 = yuv2monowhite_2_c;1478 *yuv2packed2 = yuv2monowhite_2_c;
1479 *yuv2packedX = yuv2monowhite_X_c;1479 *yuv2packedX = yuv2monowhite_X_c;
1480 break;1480 break;
1481 case PIX_FMT_MONOBLACK:1481 case AV_PIX_FMT_MONOBLACK:
1482 *yuv2packed1 = yuv2monoblack_1_c;1482 *yuv2packed1 = yuv2monoblack_1_c;
1483 *yuv2packed2 = yuv2monoblack_2_c;1483 *yuv2packed2 = yuv2monoblack_2_c;
1484 *yuv2packedX = yuv2monoblack_X_c;1484 *yuv2packedX = yuv2monoblack_X_c;
1485 break;1485 break;
1486 case PIX_FMT_YUYV422:1486 case AV_PIX_FMT_YUYV422:
1487 *yuv2packed1 = yuv2yuyv422_1_c;1487 *yuv2packed1 = yuv2yuyv422_1_c;
1488 *yuv2packed2 = yuv2yuyv422_2_c;1488 *yuv2packed2 = yuv2yuyv422_2_c;
1489 *yuv2packedX = yuv2yuyv422_X_c;1489 *yuv2packedX = yuv2yuyv422_X_c;
1490 break;1490 break;
1491 case PIX_FMT_UYVY422:1491 case AV_PIX_FMT_UYVY422:
1492 *yuv2packed1 = yuv2uyvy422_1_c;1492 *yuv2packed1 = yuv2uyvy422_1_c;
1493 *yuv2packed2 = yuv2uyvy422_2_c;1493 *yuv2packed2 = yuv2uyvy422_2_c;
1494 *yuv2packedX = yuv2uyvy422_X_c;1494 *yuv2packedX = yuv2uyvy422_X_c;
libswscale/ppc/swscale_altivec.c+8−8
@@ -287,7 +287,7 @@ static void hScale_altivec_real(SwsContext *c, int16_t *dst, int dstW, · 286 unmodified lines
287 287
288av_cold void ff_sws_init_swScale_altivec(SwsContext *c)288av_cold void ff_sws_init_swScale_altivec(SwsContext *c)
289{289{
290 enum PixelFormat dstFormat = c->dstFormat;290 enum AVPixelFormat dstFormat = c->dstFormat;
291 291
292 if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))292 if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
293 return;293 return;
@@ -296,7 +296,7 @@ av_cold void ff_sws_init_swScale_altivec(SwsContext *c) · 2 unmodified lines
296 c->hyScale = c->hcScale = hScale_altivec_real;296 c->hyScale = c->hcScale = hScale_altivec_real;
297 }297 }
298 if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&298 if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
299 dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 &&299 dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
300 !c->alpPixBuf) {300 !c->alpPixBuf) {
301 c->yuv2planeX = yuv2planeX_altivec;301 c->yuv2planeX = yuv2planeX_altivec;
302 }302 }
@@ -305,22 +305,22 @@ av_cold void ff_sws_init_swScale_altivec(SwsContext *c) · 2 unmodified lines
305 * match what's found in the body of ff_yuv2packedX_altivec() */305 * match what's found in the body of ff_yuv2packedX_altivec() */
306 if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf) {306 if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf) {
307 switch (c->dstFormat) {307 switch (c->dstFormat) {
308 case PIX_FMT_ABGR:308 case AV_PIX_FMT_ABGR:
309 c->yuv2packedX = ff_yuv2abgr_X_altivec;309 c->yuv2packedX = ff_yuv2abgr_X_altivec;
310 break;310 break;
311 case PIX_FMT_BGRA:311 case AV_PIX_FMT_BGRA:
312 c->yuv2packedX = ff_yuv2bgra_X_altivec;312 c->yuv2packedX = ff_yuv2bgra_X_altivec;
313 break;313 break;
314 case PIX_FMT_ARGB:314 case AV_PIX_FMT_ARGB:
315 c->yuv2packedX = ff_yuv2argb_X_altivec;315 c->yuv2packedX = ff_yuv2argb_X_altivec;
316 break;316 break;
317 case PIX_FMT_RGBA:317 case AV_PIX_FMT_RGBA:
318 c->yuv2packedX = ff_yuv2rgba_X_altivec;318 c->yuv2packedX = ff_yuv2rgba_X_altivec;
319 break;319 break;
320 case PIX_FMT_BGR24:320 case AV_PIX_FMT_BGR24:
321 c->yuv2packedX = ff_yuv2bgr24_X_altivec;321 c->yuv2packedX = ff_yuv2bgr24_X_altivec;
322 break;322 break;
323 case PIX_FMT_RGB24:323 case AV_PIX_FMT_RGB24:
324 c->yuv2packedX = ff_yuv2rgb24_X_altivec;324 c->yuv2packedX = ff_yuv2rgb24_X_altivec;
325 break;325 break;
326 }326 }
libswscale/ppc/yuv2rgb_altivec.c+32−32
@@ -552,41 +552,41 @@ av_cold SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c) · 551 unmodified lines
552 return NULL;552 return NULL;
553 553
554 switch (c->srcFormat) {554 switch (c->srcFormat) {
555 case PIX_FMT_YUV410P:555 case AV_PIX_FMT_YUV410P:
556 case PIX_FMT_YUV420P:556 case AV_PIX_FMT_YUV420P:
557 /*case IMGFMT_CLPL: ??? */557 /*case IMGFMT_CLPL: ??? */
558 case PIX_FMT_GRAY8:558 case AV_PIX_FMT_GRAY8:
559 case PIX_FMT_NV12:559 case AV_PIX_FMT_NV12:
560 case PIX_FMT_NV21:560 case AV_PIX_FMT_NV21:
561 if ((c->srcH & 0x1) != 0)561 if ((c->srcH & 0x1) != 0)
562 return NULL;562 return NULL;
563 563
564 switch (c->dstFormat) {564 switch (c->dstFormat) {
565 case PIX_FMT_RGB24:565 case AV_PIX_FMT_RGB24:
566 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGB24\n");566 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGB24\n");
567 return altivec_yuv2_rgb24;567 return altivec_yuv2_rgb24;
568 case PIX_FMT_BGR24:568 case AV_PIX_FMT_BGR24:
569 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGR24\n");569 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGR24\n");
570 return altivec_yuv2_bgr24;570 return altivec_yuv2_bgr24;
571 case PIX_FMT_ARGB:571 case AV_PIX_FMT_ARGB:
572 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ARGB\n");572 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ARGB\n");
573 return altivec_yuv2_argb;573 return altivec_yuv2_argb;
574 case PIX_FMT_ABGR:574 case AV_PIX_FMT_ABGR:
575 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ABGR\n");575 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ABGR\n");
576 return altivec_yuv2_abgr;576 return altivec_yuv2_abgr;
577 case PIX_FMT_RGBA:577 case AV_PIX_FMT_RGBA:
578 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGBA\n");578 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGBA\n");
579 return altivec_yuv2_rgba;579 return altivec_yuv2_rgba;
580 case PIX_FMT_BGRA:580 case AV_PIX_FMT_BGRA:
581 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGRA\n");581 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGRA\n");
582 return altivec_yuv2_bgra;582 return altivec_yuv2_bgra;
583 default: return NULL;583 default: return NULL;
584 }584 }
585 break;585 break;
586 586
587 case PIX_FMT_UYVY422:587 case AV_PIX_FMT_UYVY422:
588 switch (c->dstFormat) {588 switch (c->dstFormat) {
589 case PIX_FMT_BGR32:589 case AV_PIX_FMT_BGR32:
590 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space UYVY -> RGB32\n");590 av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space UYVY -> RGB32\n");
591 return altivec_uyvy_rgb32;591 return altivec_uyvy_rgb32;
592 default: return NULL;592 default: return NULL;
@@ -635,7 +635,7 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c, · 42 unmodified lines
635 const int16_t **alpSrc,635 const int16_t **alpSrc,
636 uint8_t *dest,636 uint8_t *dest,
637 int dstW, int dstY,637 int dstW, int dstY,
638 enum PixelFormat target)638 enum AVPixelFormat target)
639{639{
640 int i, j;640 int i, j;
641 vector signed short X, X0, X1, Y0, U0, V0, Y1, U1, V1, U, V;641 vector signed short X, X0, X1, Y0, U0, V0, Y1, U1, V1, U, V;
@@ -710,22 +710,22 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c, · 68 unmodified lines
710 B = vec_packclp(B0, B1);710 B = vec_packclp(B0, B1);
711 711
712 switch (target) {712 switch (target) {
713 case PIX_FMT_ABGR:713 case AV_PIX_FMT_ABGR:
714 out_abgr(R, G, B, out);714 out_abgr(R, G, B, out);
715 break;715 break;
716 case PIX_FMT_BGRA:716 case AV_PIX_FMT_BGRA:
717 out_bgra(R, G, B, out);717 out_bgra(R, G, B, out);
718 break;718 break;
719 case PIX_FMT_RGBA:719 case AV_PIX_FMT_RGBA:
720 out_rgba(R, G, B, out);720 out_rgba(R, G, B, out);
721 break;721 break;
722 case PIX_FMT_ARGB:722 case AV_PIX_FMT_ARGB:
723 out_argb(R, G, B, out);723 out_argb(R, G, B, out);
724 break;724 break;
725 case PIX_FMT_RGB24:725 case AV_PIX_FMT_RGB24:
726 out_rgb24(R, G, B, out);726 out_rgb24(R, G, B, out);
727 break;727 break;
728 case PIX_FMT_BGR24:728 case AV_PIX_FMT_BGR24:
729 out_bgr24(R, G, B, out);729 out_bgr24(R, G, B, out);
730 break;730 break;
731 default:731 default:
@@ -802,22 +802,22 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c, · 70 unmodified lines
802 802
803 nout = (vector unsigned char *) scratch;803 nout = (vector unsigned char *) scratch;
804 switch (target) {804 switch (target) {
805 case PIX_FMT_ABGR:805 case AV_PIX_FMT_ABGR:
806 out_abgr(R, G, B, nout);806 out_abgr(R, G, B, nout);
807 break;807 break;
808 case PIX_FMT_BGRA:808 case AV_PIX_FMT_BGRA:
809 out_bgra(R, G, B, nout);809 out_bgra(R, G, B, nout);
810 break;810 break;
811 case PIX_FMT_RGBA:811 case AV_PIX_FMT_RGBA:
812 out_rgba(R, G, B, nout);812 out_rgba(R, G, B, nout);
813 break;813 break;
814 case PIX_FMT_ARGB:814 case AV_PIX_FMT_ARGB:
815 out_argb(R, G, B, nout);815 out_argb(R, G, B, nout);
816 break;816 break;
817 case PIX_FMT_RGB24:817 case AV_PIX_FMT_RGB24:
818 out_rgb24(R, G, B, nout);818 out_rgb24(R, G, B, nout);
819 break;819 break;
820 case PIX_FMT_BGR24:820 case AV_PIX_FMT_BGR24:
821 out_bgr24(R, G, B, nout);821 out_bgr24(R, G, B, nout);
822 break;822 break;
823 default:823 default:
@@ -850,9 +850,9 @@ void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c, \ · 26 unmodified lines
850 dest, dstW, dstY, pixfmt); \850 dest, dstW, dstY, pixfmt); \
851}851}
852 852
853YUV2PACKEDX_WRAPPER(abgr, PIX_FMT_ABGR);853YUV2PACKEDX_WRAPPER(abgr, AV_PIX_FMT_ABGR);
854YUV2PACKEDX_WRAPPER(bgra, PIX_FMT_BGRA);854YUV2PACKEDX_WRAPPER(bgra, AV_PIX_FMT_BGRA);
855YUV2PACKEDX_WRAPPER(argb, PIX_FMT_ARGB);855YUV2PACKEDX_WRAPPER(argb, AV_PIX_FMT_ARGB);
856YUV2PACKEDX_WRAPPER(rgba, PIX_FMT_RGBA);856YUV2PACKEDX_WRAPPER(rgba, AV_PIX_FMT_RGBA);
857YUV2PACKEDX_WRAPPER(rgb24, PIX_FMT_RGB24);857YUV2PACKEDX_WRAPPER(rgb24, AV_PIX_FMT_RGB24);
858YUV2PACKEDX_WRAPPER(bgr24, PIX_FMT_BGR24);858YUV2PACKEDX_WRAPPER(bgr24, AV_PIX_FMT_BGR24);
libswscale/ppc/yuv2yuv_altivec.c+4−4
@@ -182,13 +182,13 @@ static int yv12touyvy_unscaled_altivec(SwsContext *c, const uint8_t *src[], · 181 unmodified lines
182void ff_swscale_get_unscaled_altivec(SwsContext *c)182void ff_swscale_get_unscaled_altivec(SwsContext *c)
183{183{
184 if ((av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) && !(c->srcW & 15) &&184 if ((av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) && !(c->srcW & 15) &&
185 !(c->flags & SWS_BITEXACT) && c->srcFormat == PIX_FMT_YUV420P) {185 !(c->flags & SWS_BITEXACT) && c->srcFormat == AV_PIX_FMT_YUV420P) {
186 enum PixelFormat dstFormat = c->dstFormat;186 enum AVPixelFormat dstFormat = c->dstFormat;
187 187
188 // unscaled YV12 -> packed YUV, we want speed188 // unscaled YV12 -> packed YUV, we want speed
189 if (dstFormat == PIX_FMT_YUYV422)189 if (dstFormat == AV_PIX_FMT_YUYV422)
190 c->swScale = yv12toyuy2_unscaled_altivec;190 c->swScale = yv12toyuy2_unscaled_altivec;
191 else if (dstFormat == PIX_FMT_UYVY422)191 else if (dstFormat == AV_PIX_FMT_UYVY422)
192 c->swScale = yv12touyvy_unscaled_altivec;192 c->swScale = yv12touyvy_unscaled_altivec;
193 }193 }
194}194}
libswscale/sparc/yuv2rgb_vis.c+2−2
@@ -199,11 +199,11 @@ av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c) · 198 unmodified lines
199 c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;199 c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
200 c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;200 c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
201 201
202 if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV422P && (c->dstW & 7) == 0) {202 if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV422P && (c->dstW & 7) == 0) {
203 av_log(c, AV_LOG_INFO,203 av_log(c, AV_LOG_INFO,
204 "SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");204 "SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");
205 return vis_422P_ARGB32;205 return vis_422P_ARGB32;
206 } else if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV420P && (c->dstW & 7) == 0) {206 } else if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV420P && (c->dstW & 7) == 0) {
207 av_log(c, AV_LOG_INFO,207 av_log(c, AV_LOG_INFO,
208 "SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");208 "SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");
209 return vis_420P_ARGB32;209 return vis_420P_ARGB32;
libswscale/swscale-test.c+39−39
@@ -36,20 +36,20 @@ · 35 unmodified lines
36/* HACK Duplicated from swscale_internal.h.36/* HACK Duplicated from swscale_internal.h.
37 * Should be removed when a cleaner pixel format system exists. */37 * Should be removed when a cleaner pixel format system exists. */
38#define isGray(x) \38#define isGray(x) \
39 ((x) == PIX_FMT_GRAY8 || \39 ((x) == AV_PIX_FMT_GRAY8 || \
40 (x) == PIX_FMT_Y400A || \40 (x) == AV_PIX_FMT_Y400A || \
41 (x) == PIX_FMT_GRAY16BE || \41 (x) == AV_PIX_FMT_GRAY16BE || \
42 (x) == PIX_FMT_GRAY16LE)42 (x) == AV_PIX_FMT_GRAY16LE)
43#define hasChroma(x) \43#define hasChroma(x) \
44 (!(isGray(x) || \44 (!(isGray(x) || \
45 (x) == PIX_FMT_MONOBLACK || \45 (x) == AV_PIX_FMT_MONOBLACK || \
46 (x) == PIX_FMT_MONOWHITE))46 (x) == AV_PIX_FMT_MONOWHITE))
47#define isALPHA(x) \47#define isALPHA(x) \
48 ((x) == PIX_FMT_BGR32 || \48 ((x) == AV_PIX_FMT_BGR32 || \
49 (x) == PIX_FMT_BGR32_1 || \49 (x) == AV_PIX_FMT_BGR32_1 || \
50 (x) == PIX_FMT_RGB32 || \50 (x) == AV_PIX_FMT_RGB32 || \
51 (x) == PIX_FMT_RGB32_1 || \51 (x) == AV_PIX_FMT_RGB32_1 || \
52 (x) == PIX_FMT_YUVA420P)52 (x) == AV_PIX_FMT_YUVA420P)
53 53
54static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1,54static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1,
55 int stride2, int w, int h)55 int stride2, int w, int h)
@@ -77,11 +77,11 @@ struct Results { · 21 unmodified lines
77// test by ref -> src -> dst -> out & compare out against ref77// test by ref -> src -> dst -> out & compare out against ref
78// ref & out are YV1278// ref & out are YV12
79static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,79static int doTest(uint8_t *ref[4], int refStride[4], int w, int h,
80 enum PixelFormat srcFormat, enum PixelFormat dstFormat,80 enum AVPixelFormat srcFormat, enum AVPixelFormat dstFormat,
81 int srcW, int srcH, int dstW, int dstH, int flags,81 int srcW, int srcH, int dstW, int dstH, int flags,
82 struct Results *r)82 struct Results *r)
83{83{
84 static enum PixelFormat cur_srcFormat;84 static enum AVPixelFormat cur_srcFormat;
85 static int cur_srcW, cur_srcH;85 static int cur_srcW, cur_srcH;
86 static uint8_t *src[4];86 static uint8_t *src[4];
87 static int srcStride[4];87 static int srcStride[4];
@@ -111,11 +111,11 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, · 23 unmodified lines
111 goto end;111 goto end;
112 }112 }
113 }113 }
114 srcContext = sws_getContext(w, h, PIX_FMT_YUVA420P, srcW, srcH,114 srcContext = sws_getContext(w, h, AV_PIX_FMT_YUVA420P, srcW, srcH,
115 srcFormat, SWS_BILINEAR, NULL, NULL, NULL);115 srcFormat, SWS_BILINEAR, NULL, NULL, NULL);
116 if (!srcContext) {116 if (!srcContext) {
117 fprintf(stderr, "Failed to get %s ---> %s\n",117 fprintf(stderr, "Failed to get %s ---> %s\n",
118 av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name,118 av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name,
119 av_pix_fmt_descriptors[srcFormat].name);119 av_pix_fmt_descriptors[srcFormat].name);
120 res = -1;120 res = -1;
121 goto end;121 goto end;
@@ -184,12 +184,12 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, · 62 unmodified lines
184 }184 }
185 }185 }
186 outContext = sws_getContext(dstW, dstH, dstFormat, w, h,186 outContext = sws_getContext(dstW, dstH, dstFormat, w, h,
187 PIX_FMT_YUVA420P, SWS_BILINEAR,187 AV_PIX_FMT_YUVA420P, SWS_BILINEAR,
188 NULL, NULL, NULL);188 NULL, NULL, NULL);
189 if (!outContext) {189 if (!outContext) {
190 fprintf(stderr, "Failed to get %s ---> %s\n",190 fprintf(stderr, "Failed to get %s ---> %s\n",
191 av_pix_fmt_descriptors[dstFormat].name,191 av_pix_fmt_descriptors[dstFormat].name,
192 av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name);192 av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name);
193 res = -1;193 res = -1;
194 goto end;194 goto end;
195 }195 }
@@ -232,8 +232,8 @@ end: · 36 unmodified lines
232}232}
233 233
234static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,234static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h,
235 enum PixelFormat srcFormat_in,235 enum AVPixelFormat srcFormat_in,
236 enum PixelFormat dstFormat_in)236 enum AVPixelFormat dstFormat_in)
237{237{
238 const int flags[] = { SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC,238 const int flags[] = { SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC,
239 SWS_X, SWS_POINT, SWS_AREA, 0 };239 SWS_X, SWS_POINT, SWS_AREA, 0 };
@@ -241,16 +241,16 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, · 1 unmodified line
241 const int srcH = h;241 const int srcH = h;
242 const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 };242 const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 };
243 const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 };243 const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 };
244 enum PixelFormat srcFormat, dstFormat;244 enum AVPixelFormat srcFormat, dstFormat;
245 245
246 for (srcFormat = srcFormat_in != PIX_FMT_NONE ? srcFormat_in : 0;246 for (srcFormat = srcFormat_in != AV_PIX_FMT_NONE ? srcFormat_in : 0;
247 srcFormat < PIX_FMT_NB; srcFormat++) {247 srcFormat < AV_PIX_FMT_NB; srcFormat++) {
248 if (!sws_isSupportedInput(srcFormat) ||248 if (!sws_isSupportedInput(srcFormat) ||
249 !sws_isSupportedOutput(srcFormat))249 !sws_isSupportedOutput(srcFormat))
250 continue;250 continue;
251 251
252 for (dstFormat = dstFormat_in != PIX_FMT_NONE ? dstFormat_in : 0;252 for (dstFormat = dstFormat_in != AV_PIX_FMT_NONE ? dstFormat_in : 0;
253 dstFormat < PIX_FMT_NB; dstFormat++) {253 dstFormat < AV_PIX_FMT_NB; dstFormat++) {
254 int i, j, k;254 int i, j, k;
255 int res = 0;255 int res = 0;
256 256
@@ -270,26 +270,26 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, · 13 unmodified lines
270 srcFormat, dstFormat,270 srcFormat, dstFormat,
271 srcW, srcH, dstW[i], dstH[j], flags[k],271 srcW, srcH, dstW[i], dstH[j], flags[k],
272 NULL);272 NULL);
273 if (dstFormat_in != PIX_FMT_NONE)273 if (dstFormat_in != AV_PIX_FMT_NONE)
274 break;274 break;
275 }275 }
276 if (srcFormat_in != PIX_FMT_NONE)276 if (srcFormat_in != AV_PIX_FMT_NONE)
277 break;277 break;
278 }278 }
279}279}
280 280
281static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,281static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
282 enum PixelFormat srcFormat_in,282 enum AVPixelFormat srcFormat_in,
283 enum PixelFormat dstFormat_in)283 enum AVPixelFormat dstFormat_in)
284{284{
285 char buf[256];285 char buf[256];
286 286
287 while (fgets(buf, sizeof(buf), fp)) {287 while (fgets(buf, sizeof(buf), fp)) {
288 struct Results r;288 struct Results r;
289 enum PixelFormat srcFormat;289 enum AVPixelFormat srcFormat;
290 char srcStr[12];290 char srcStr[12];
291 int srcW, srcH;291 int srcW, srcH;
292 enum PixelFormat dstFormat;292 enum AVPixelFormat dstFormat;
293 char dstStr[12];293 char dstStr[12];
294 int dstW, dstH;294 int dstW, dstH;
295 int flags;295 int flags;
@@ -308,12 +308,12 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, · 12 unmodified lines
308 srcFormat = av_get_pix_fmt(srcStr);308 srcFormat = av_get_pix_fmt(srcStr);
309 dstFormat = av_get_pix_fmt(dstStr);309 dstFormat = av_get_pix_fmt(dstStr);
310 310
311 if (srcFormat == PIX_FMT_NONE || dstFormat == PIX_FMT_NONE) {311 if (srcFormat == AV_PIX_FMT_NONE || dstFormat == AV_PIX_FMT_NONE) {
312 fprintf(stderr, "malformed input file\n");312 fprintf(stderr, "malformed input file\n");
313 return -1;313 return -1;
314 }314 }
315 if ((srcFormat_in != PIX_FMT_NONE && srcFormat_in != srcFormat) ||315 if ((srcFormat_in != AV_PIX_FMT_NONE && srcFormat_in != srcFormat) ||
316 (dstFormat_in != PIX_FMT_NONE && dstFormat_in != dstFormat))316 (dstFormat_in != AV_PIX_FMT_NONE && dstFormat_in != dstFormat))
317 continue;317 continue;
318 if (ret != 12) {318 if (ret != 12) {
319 printf("%s", buf);319 printf("%s", buf);
@@ -334,8 +334,8 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, · 14 unmodified lines
334 334
335int main(int argc, char **argv)335int main(int argc, char **argv)
336{336{
337 enum PixelFormat srcFormat = PIX_FMT_NONE;337 enum AVPixelFormat srcFormat = AV_PIX_FMT_NONE;
338 enum PixelFormat dstFormat = PIX_FMT_NONE;338 enum AVPixelFormat dstFormat = AV_PIX_FMT_NONE;
339 uint8_t *rgb_data = av_malloc(W * H * 4);339 uint8_t *rgb_data = av_malloc(W * H * 4);
340 uint8_t *rgb_src[4] = { rgb_data, NULL, NULL, NULL };340 uint8_t *rgb_src[4] = { rgb_data, NULL, NULL, NULL };
341 int rgb_stride[4] = { 4 * W, 0, 0, 0 };341 int rgb_stride[4] = { 4 * W, 0, 0, 0 };
@@ -351,8 +351,8 @@ int main(int argc, char **argv) · 9 unmodified lines
351 if (!rgb_data || !data)351 if (!rgb_data || !data)
352 return -1;352 return -1;
353 353
354 sws = sws_getContext(W / 12, H / 12, PIX_FMT_RGB32, W, H,354 sws = sws_getContext(W / 12, H / 12, AV_PIX_FMT_RGB32, W, H,
355 PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL);355 AV_PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL);
356 356
357 av_lfg_init(&rand, 1);357 av_lfg_init(&rand, 1);
358 358
@@ -377,13 +377,13 @@ int main(int argc, char **argv) · 18 unmodified lines
377 goto end;377 goto end;
378 } else if (!strcmp(argv[i], "-src")) {378 } else if (!strcmp(argv[i], "-src")) {
379 srcFormat = av_get_pix_fmt(argv[i + 1]);379 srcFormat = av_get_pix_fmt(argv[i + 1]);
380 if (srcFormat == PIX_FMT_NONE) {380 if (srcFormat == AV_PIX_FMT_NONE) {
381 fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);381 fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
382 return -1;382 return -1;
383 }383 }
384 } else if (!strcmp(argv[i], "-dst")) {384 } else if (!strcmp(argv[i], "-dst")) {
385 dstFormat = av_get_pix_fmt(argv[i + 1]);385 dstFormat = av_get_pix_fmt(argv[i + 1]);
386 if (dstFormat == PIX_FMT_NONE) {386 if (dstFormat == AV_PIX_FMT_NONE) {
387 fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);387 fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]);
388 return -1;388 return -1;
389 }389 }
libswscale/swscale.c+3−3
@@ -326,7 +326,7 @@ static int swScale(SwsContext *c, const uint8_t *src[], · 325 unmodified lines
326 const int chrSrcW = c->chrSrcW;326 const int chrSrcW = c->chrSrcW;
327 const int lumXInc = c->lumXInc;327 const int lumXInc = c->lumXInc;
328 const int chrXInc = c->chrXInc;328 const int chrXInc = c->chrXInc;
329 const enum PixelFormat dstFormat = c->dstFormat;329 const enum AVPixelFormat dstFormat = c->dstFormat;
330 const int flags = c->flags;330 const int flags = c->flags;
331 int32_t *vLumFilterPos = c->vLumFilterPos;331 int32_t *vLumFilterPos = c->vLumFilterPos;
332 int32_t *vChrFilterPos = c->vChrFilterPos;332 int32_t *vChrFilterPos = c->vChrFilterPos;
@@ -677,7 +677,7 @@ static int swScale(SwsContext *c, const uint8_t *src[], · 344 unmodified lines
677 677
678static av_cold void sws_init_swScale_c(SwsContext *c)678static av_cold void sws_init_swScale_c(SwsContext *c)
679{679{
680 enum PixelFormat srcFormat = c->srcFormat;680 enum AVPixelFormat srcFormat = c->srcFormat;
681 681
682 ff_sws_init_output_funcs(c, &c->yuv2plane1, &c->yuv2planeX,682 ff_sws_init_output_funcs(c, &c->yuv2plane1, &c->yuv2planeX,
683 &c->yuv2nv12cX, &c->yuv2packed1,683 &c->yuv2nv12cX, &c->yuv2packed1,
@@ -721,7 +721,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c) · 37 unmodified lines
721 }721 }
722 722
723 if (!(isGray(srcFormat) || isGray(c->dstFormat) ||723 if (!(isGray(srcFormat) || isGray(c->dstFormat) ||
724 srcFormat == PIX_FMT_MONOBLACK || srcFormat == PIX_FMT_MONOWHITE))724 srcFormat == AV_PIX_FMT_MONOBLACK || srcFormat == AV_PIX_FMT_MONOWHITE))
725 c->needs_hcscale = 1;725 c->needs_hcscale = 1;
726}726}
727 727
libswscale/swscale.h+6−6
@@ -134,13 +134,13 @@ struct SwsContext; · 133 unmodified lines
134 * Return a positive value if pix_fmt is a supported input format, 0134 * Return a positive value if pix_fmt is a supported input format, 0
135 * otherwise.135 * otherwise.
136 */136 */
137int sws_isSupportedInput(enum PixelFormat pix_fmt);137int sws_isSupportedInput(enum AVPixelFormat pix_fmt);
138 138
139/**139/**
140 * Return a positive value if pix_fmt is a supported output format, 0140 * Return a positive value if pix_fmt is a supported output format, 0
141 * otherwise.141 * otherwise.
142 */142 */
143int sws_isSupportedOutput(enum PixelFormat pix_fmt);143int sws_isSupportedOutput(enum AVPixelFormat pix_fmt);
144 144
145/**145/**
146 * Allocate an empty SwsContext. This must be filled and passed to146 * Allocate an empty SwsContext. This must be filled and passed to
@@ -180,8 +180,8 @@ void sws_freeContext(struct SwsContext *swsContext); · 33 unmodified lines
180 * written180 * written
181 * @deprecated Use sws_getCachedContext() instead.181 * @deprecated Use sws_getCachedContext() instead.
182 */182 */
183struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,183struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
184 int dstW, int dstH, enum PixelFormat dstFormat,184 int dstW, int dstH, enum AVPixelFormat dstFormat,
185 int flags, SwsFilter *srcFilter,185 int flags, SwsFilter *srcFilter,
186 SwsFilter *dstFilter, const double *param);186 SwsFilter *dstFilter, const double *param);
187#endif187#endif
@@ -301,8 +301,8 @@ void sws_freeFilter(SwsFilter *filter); · 113 unmodified lines
301 * are assumed to remain the same.301 * are assumed to remain the same.
302 */302 */
303struct SwsContext *sws_getCachedContext(struct SwsContext *context,303struct SwsContext *sws_getCachedContext(struct SwsContext *context,
304 int srcW, int srcH, enum PixelFormat srcFormat,304 int srcW, int srcH, enum AVPixelFormat srcFormat,
305 int dstW, int dstH, enum PixelFormat dstFormat,305 int dstW, int dstH, enum AVPixelFormat dstFormat,
306 int flags, SwsFilter *srcFilter,306 int flags, SwsFilter *srcFilter,
307 SwsFilter *dstFilter, const double *param);307 SwsFilter *dstFilter, const double *param);
308 308
libswscale/swscale_internal.h+41−41
@@ -238,8 +238,8 @@ typedef struct SwsContext { · 237 unmodified lines
238 int chrDstH; ///< Height of destination chroma planes.238 int chrDstH; ///< Height of destination chroma planes.
239 int lumXInc, chrXInc;239 int lumXInc, chrXInc;
240 int lumYInc, chrYInc;240 int lumYInc, chrYInc;
241 enum PixelFormat dstFormat; ///< Destination pixel format.241 enum AVPixelFormat dstFormat; ///< Destination pixel format.
242 enum PixelFormat srcFormat; ///< Source pixel format.242 enum AVPixelFormat srcFormat; ///< Source pixel format.
243 int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format.243 int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format.
244 int srcFormatBpp; ///< Number of bits per pixel of the source pixel format.244 int srcFormatBpp; ///< Number of bits per pixel of the source pixel format.
245 int dstBpc, srcBpc;245 int dstBpc, srcBpc;
@@ -540,7 +540,7 @@ SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c); · 294 unmodified lines
540SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c);540SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c);
541void ff_bfin_get_unscaled_swscale(SwsContext *c);541void ff_bfin_get_unscaled_swscale(SwsContext *c);
542 542
543const char *sws_format_name(enum PixelFormat format);543const char *sws_format_name(enum AVPixelFormat format);
544 544
545#define is16BPS(x) \545#define is16BPS(x) \
546 (av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 15)546 (av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 15)
@@ -569,47 +569,47 @@ const char *sws_format_name(enum PixelFormat format); · 22 unmodified lines
569 av_pix_fmt_descriptors[x].nb_components <= 2)569 av_pix_fmt_descriptors[x].nb_components <= 2)
570#else570#else
571#define isGray(x) \571#define isGray(x) \
572 ((x) == PIX_FMT_GRAY8 || \572 ((x) == AV_PIX_FMT_GRAY8 || \
573 (x) == PIX_FMT_Y400A || \573 (x) == AV_PIX_FMT_Y400A || \
574 (x) == PIX_FMT_GRAY16BE || \574 (x) == AV_PIX_FMT_GRAY16BE || \
575 (x) == PIX_FMT_GRAY16LE)575 (x) == AV_PIX_FMT_GRAY16LE)
576#endif576#endif
577 577
578#define isRGBinInt(x) \578#define isRGBinInt(x) \
579 ((x) == PIX_FMT_RGB48BE || \579 ((x) == AV_PIX_FMT_RGB48BE || \
580 (x) == PIX_FMT_RGB48LE || \580 (x) == AV_PIX_FMT_RGB48LE || \
581 (x) == PIX_FMT_RGB32 || \581 (x) == AV_PIX_FMT_RGB32 || \
582 (x) == PIX_FMT_RGB32_1 || \582 (x) == AV_PIX_FMT_RGB32_1 || \
583 (x) == PIX_FMT_RGB24 || \583 (x) == AV_PIX_FMT_RGB24 || \
584 (x) == PIX_FMT_RGB565BE || \584 (x) == AV_PIX_FMT_RGB565BE || \
585 (x) == PIX_FMT_RGB565LE || \585 (x) == AV_PIX_FMT_RGB565LE || \
586 (x) == PIX_FMT_RGB555BE || \586 (x) == AV_PIX_FMT_RGB555BE || \
587 (x) == PIX_FMT_RGB555LE || \587 (x) == AV_PIX_FMT_RGB555LE || \
588 (x) == PIX_FMT_RGB444BE || \588 (x) == AV_PIX_FMT_RGB444BE || \
589 (x) == PIX_FMT_RGB444LE || \589 (x) == AV_PIX_FMT_RGB444LE || \
590 (x) == PIX_FMT_RGB8 || \590 (x) == AV_PIX_FMT_RGB8 || \
591 (x) == PIX_FMT_RGB4 || \591 (x) == AV_PIX_FMT_RGB4 || \
592 (x) == PIX_FMT_RGB4_BYTE || \592 (x) == AV_PIX_FMT_RGB4_BYTE || \
593 (x) == PIX_FMT_MONOBLACK || \593 (x) == AV_PIX_FMT_MONOBLACK || \
594 (x) == PIX_FMT_MONOWHITE)594 (x) == AV_PIX_FMT_MONOWHITE)
595 595
596#define isBGRinInt(x) \596#define isBGRinInt(x) \
597 ((x) == PIX_FMT_BGR48BE || \597 ((x) == AV_PIX_FMT_BGR48BE || \
598 (x) == PIX_FMT_BGR48LE || \598 (x) == AV_PIX_FMT_BGR48LE || \
599 (x) == PIX_FMT_BGR32 || \599 (x) == AV_PIX_FMT_BGR32 || \
600 (x) == PIX_FMT_BGR32_1 || \600 (x) == AV_PIX_FMT_BGR32_1 || \
601 (x) == PIX_FMT_BGR24 || \601 (x) == AV_PIX_FMT_BGR24 || \
602 (x) == PIX_FMT_BGR565BE || \602 (x) == AV_PIX_FMT_BGR565BE || \
603 (x) == PIX_FMT_BGR565LE || \603 (x) == AV_PIX_FMT_BGR565LE || \
604 (x) == PIX_FMT_BGR555BE || \604 (x) == AV_PIX_FMT_BGR555BE || \
605 (x) == PIX_FMT_BGR555LE || \605 (x) == AV_PIX_FMT_BGR555LE || \
606 (x) == PIX_FMT_BGR444BE || \606 (x) == AV_PIX_FMT_BGR444BE || \
607 (x) == PIX_FMT_BGR444LE || \607 (x) == AV_PIX_FMT_BGR444LE || \
608 (x) == PIX_FMT_BGR8 || \608 (x) == AV_PIX_FMT_BGR8 || \
609 (x) == PIX_FMT_BGR4 || \609 (x) == AV_PIX_FMT_BGR4 || \
610 (x) == PIX_FMT_BGR4_BYTE || \610 (x) == AV_PIX_FMT_BGR4_BYTE || \
611 (x) == PIX_FMT_MONOBLACK || \611 (x) == AV_PIX_FMT_MONOBLACK || \
612 (x) == PIX_FMT_MONOWHITE)612 (x) == AV_PIX_FMT_MONOWHITE)
613 613
614#define isAnyRGB(x) \614#define isAnyRGB(x) \
615 (isRGBinInt(x) || \615 (isRGBinInt(x) || \
@@ -622,7 +622,7 @@ const char *sws_format_name(enum PixelFormat format); · 6 unmodified lines
622#define isPacked(x) \622#define isPacked(x) \
623 ((av_pix_fmt_descriptors[x].nb_components >= 2 && \623 ((av_pix_fmt_descriptors[x].nb_components >= 2 && \
624 !(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR)) || \624 !(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR)) || \
625 (x) == PIX_FMT_PAL8)625 (x) == AV_PIX_FMT_PAL8)
626 626
627#define isPlanar(x) \627#define isPlanar(x) \
628 (av_pix_fmt_descriptors[x].nb_components >= 2 && \628 (av_pix_fmt_descriptors[x].nb_components >= 2 && \
@@ -638,7 +638,7 @@ const char *sws_format_name(enum PixelFormat format); · 9 unmodified lines
638 638
639#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || \639#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || \
640 (av_pix_fmt_descriptors[x].flags & PIX_FMT_PSEUDOPAL) || \640 (av_pix_fmt_descriptors[x].flags & PIX_FMT_PSEUDOPAL) || \
641 (x) == PIX_FMT_Y400A)641 (x) == AV_PIX_FMT_Y400A)
642 642
643extern const uint64_t ff_dither4[2];643extern const uint64_t ff_dither4[2];
644extern const uint64_t ff_dither8[2];644extern const uint64_t ff_dither8[2];
libswscale/swscale_unscaled.c+91−91
@@ -125,7 +125,7 @@ static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[], · 124 unmodified lines
125 copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,125 copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
126 dstParam[0], dstStride[0]);126 dstParam[0], dstStride[0]);
127 127
128 if (c->dstFormat == PIX_FMT_NV12)128 if (c->dstFormat == AV_PIX_FMT_NV12)
129 interleaveBytes(src[1], src[2], dst, c->srcW / 2, srcSliceH / 2,129 interleaveBytes(src[1], src[2], dst, c->srcW / 2, srcSliceH / 2,
130 srcStride[1], srcStride[2], dstStride[0]);130 srcStride[1], srcStride[2], dstStride[0]);
131 else131 else
@@ -302,31 +302,31 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], · 170 unmodified lines
302 int srcSliceY, int srcSliceH, uint8_t *dst[],302 int srcSliceY, int srcSliceH, uint8_t *dst[],
303 int dstStride[])303 int dstStride[])
304{304{
305 const enum PixelFormat srcFormat = c->srcFormat;305 const enum AVPixelFormat srcFormat = c->srcFormat;
306 const enum PixelFormat dstFormat = c->dstFormat;306 const enum AVPixelFormat dstFormat = c->dstFormat;
307 void (*conv)(const uint8_t *src, uint8_t *dst, int num_pixels,307 void (*conv)(const uint8_t *src, uint8_t *dst, int num_pixels,
308 const uint8_t *palette) = NULL;308 const uint8_t *palette) = NULL;
309 int i;309 int i;
310 uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;310 uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY;
311 const uint8_t *srcPtr = src[0];311 const uint8_t *srcPtr = src[0];
312 312
313 if (srcFormat == PIX_FMT_Y400A) {313 if (srcFormat == AV_PIX_FMT_Y400A) {
314 switch (dstFormat) {314 switch (dstFormat) {
315 case PIX_FMT_RGB32 : conv = gray8aToPacked32; break;315 case AV_PIX_FMT_RGB32 : conv = gray8aToPacked32; break;
316 case PIX_FMT_BGR32 : conv = gray8aToPacked32; break;316 case AV_PIX_FMT_BGR32 : conv = gray8aToPacked32; break;
317 case PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break;317 case AV_PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break;
318 case PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break;318 case AV_PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break;
319 case PIX_FMT_RGB24 : conv = gray8aToPacked24; break;319 case AV_PIX_FMT_RGB24 : conv = gray8aToPacked24; break;
320 case PIX_FMT_BGR24 : conv = gray8aToPacked24; break;320 case AV_PIX_FMT_BGR24 : conv = gray8aToPacked24; break;
321 }321 }
322 } else if (usePal(srcFormat)) {322 } else if (usePal(srcFormat)) {
323 switch (dstFormat) {323 switch (dstFormat) {
324 case PIX_FMT_RGB32 : conv = sws_convertPalette8ToPacked32; break;324 case AV_PIX_FMT_RGB32 : conv = sws_convertPalette8ToPacked32; break;
325 case PIX_FMT_BGR32 : conv = sws_convertPalette8ToPacked32; break;325 case AV_PIX_FMT_BGR32 : conv = sws_convertPalette8ToPacked32; break;
326 case PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break;326 case AV_PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break;
327 case PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break;327 case AV_PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break;
328 case PIX_FMT_RGB24 : conv = sws_convertPalette8ToPacked24; break;328 case AV_PIX_FMT_RGB24 : conv = sws_convertPalette8ToPacked24; break;
329 case PIX_FMT_BGR24 : conv = sws_convertPalette8ToPacked24; break;329 case AV_PIX_FMT_BGR24 : conv = sws_convertPalette8ToPacked24; break;
330 }330 }
331 }331 }
332 332
@@ -396,7 +396,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], · 63 unmodified lines
396 uint8_t *dst[], int dstStride[])396 uint8_t *dst[], int dstStride[])
397{397{
398 int alpha_first = 0;398 int alpha_first = 0;
399 if (c->srcFormat != PIX_FMT_GBRP) {399 if (c->srcFormat != AV_PIX_FMT_GBRP) {
400 av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",400 av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
401 av_get_pix_fmt_name(c->srcFormat),401 av_get_pix_fmt_name(c->srcFormat),
402 av_get_pix_fmt_name(c->dstFormat));402 av_get_pix_fmt_name(c->dstFormat));
@@ -404,32 +404,32 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], · 1 unmodified line
404 }404 }
405 405
406 switch (c->dstFormat) {406 switch (c->dstFormat) {
407 case PIX_FMT_BGR24:407 case AV_PIX_FMT_BGR24:
408 gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },408 gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
409 (int []) { srcStride[1], srcStride[0], srcStride[2] },409 (int []) { srcStride[1], srcStride[0], srcStride[2] },
410 dst[0] + srcSliceY * dstStride[0], dstStride[0],410 dst[0] + srcSliceY * dstStride[0], dstStride[0],
411 srcSliceH, c->srcW);411 srcSliceH, c->srcW);
412 break;412 break;
413 413
414 case PIX_FMT_RGB24:414 case AV_PIX_FMT_RGB24:
415 gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] },415 gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] },
416 (int []) { srcStride[2], srcStride[0], srcStride[1] },416 (int []) { srcStride[2], srcStride[0], srcStride[1] },
417 dst[0] + srcSliceY * dstStride[0], dstStride[0],417 dst[0] + srcSliceY * dstStride[0], dstStride[0],
418 srcSliceH, c->srcW);418 srcSliceH, c->srcW);
419 break;419 break;
420 420
421 case PIX_FMT_ARGB:421 case AV_PIX_FMT_ARGB:
422 alpha_first = 1;422 alpha_first = 1;
423 case PIX_FMT_RGBA:423 case AV_PIX_FMT_RGBA:
424 gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] },424 gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] },
425 (int []) { srcStride[2], srcStride[0], srcStride[1] },425 (int []) { srcStride[2], srcStride[0], srcStride[1] },
426 dst[0] + srcSliceY * dstStride[0], dstStride[0],426 dst[0] + srcSliceY * dstStride[0], dstStride[0],
427 srcSliceH, alpha_first, c->srcW);427 srcSliceH, alpha_first, c->srcW);
428 break;428 break;
429 429
430 case PIX_FMT_ABGR:430 case AV_PIX_FMT_ABGR:
431 alpha_first = 1;431 alpha_first = 1;
432 case PIX_FMT_BGRA:432 case AV_PIX_FMT_BGRA:
433 gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] },433 gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] },
434 (int []) { srcStride[1], srcStride[0], srcStride[2] },434 (int []) { srcStride[1], srcStride[0], srcStride[2] },
435 dst[0] + srcSliceY * dstStride[0], dstStride[0],435 dst[0] + srcSliceY * dstStride[0], dstStride[0],
@@ -447,18 +447,18 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], · 11 unmodified lines
447}447}
448 448
449#define isRGBA32(x) ( \449#define isRGBA32(x) ( \
450 (x) == PIX_FMT_ARGB \450 (x) == AV_PIX_FMT_ARGB \
451 || (x) == PIX_FMT_RGBA \451 || (x) == AV_PIX_FMT_RGBA \
452 || (x) == PIX_FMT_BGRA \452 || (x) == AV_PIX_FMT_BGRA \
453 || (x) == PIX_FMT_ABGR \453 || (x) == AV_PIX_FMT_ABGR \
454 )454 )
455 455
456/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */456/* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
457typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int);457typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int);
458static rgbConvFn findRgbConvFn(SwsContext *c)458static rgbConvFn findRgbConvFn(SwsContext *c)
459{459{
460 const enum PixelFormat srcFormat = c->srcFormat;460 const enum AVPixelFormat srcFormat = c->srcFormat;
461 const enum PixelFormat dstFormat = c->dstFormat;461 const enum AVPixelFormat dstFormat = c->dstFormat;
462 const int srcId = c->srcFormatBpp;462 const int srcId = c->srcFormatBpp;
463 const int dstId = c->dstFormatBpp;463 const int dstId = c->dstFormatBpp;
464 rgbConvFn conv = NULL;464 rgbConvFn conv = NULL;
@@ -471,7 +471,7 @@ static rgbConvFn findRgbConvFn(SwsContext *c) · 6 unmodified lines
471 if (IS_NOT_NE(srcId, srcFormat) || IS_NOT_NE(dstId, dstFormat))471 if (IS_NOT_NE(srcId, srcFormat) || IS_NOT_NE(dstId, dstFormat))
472 return NULL;472 return NULL;
473 473
474#define CONV_IS(src, dst) (srcFormat == PIX_FMT_##src && dstFormat == PIX_FMT_##dst)474#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)
475 475
476 if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {476 if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {
477 if ( CONV_IS(ABGR, RGBA)477 if ( CONV_IS(ABGR, RGBA)
@@ -536,8 +536,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], · 58 unmodified lines
536 int dstStride[])536 int dstStride[])
537 537
538{538{
539 const enum PixelFormat srcFormat = c->srcFormat;539 const enum AVPixelFormat srcFormat = c->srcFormat;
540 const enum PixelFormat dstFormat = c->dstFormat;540 const enum AVPixelFormat dstFormat = c->dstFormat;
541 const int srcBpp = (c->srcFormatBpp + 7) >> 3;541 const int srcBpp = (c->srcFormatBpp + 7) >> 3;
542 const int dstBpp = (c->dstFormatBpp + 7) >> 3;542 const int dstBpp = (c->dstFormatBpp + 7) >> 3;
543 rgbConvFn conv = findRgbConvFn(c);543 rgbConvFn conv = findRgbConvFn(c);
@@ -548,11 +548,11 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], · 4 unmodified lines
548 } else {548 } else {
549 const uint8_t *srcPtr = src[0];549 const uint8_t *srcPtr = src[0];
550 uint8_t *dstPtr = dst[0];550 uint8_t *dstPtr = dst[0];
551 if ((srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1) &&551 if ((srcFormat == AV_PIX_FMT_RGB32_1 || srcFormat == AV_PIX_FMT_BGR32_1) &&
552 !isRGBA32(dstFormat))552 !isRGBA32(dstFormat))
553 srcPtr += ALT32_CORR;553 srcPtr += ALT32_CORR;
554 554
555 if ((dstFormat == PIX_FMT_RGB32_1 || dstFormat == PIX_FMT_BGR32_1) &&555 if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) &&
556 !isRGBA32(srcFormat))556 !isRGBA32(srcFormat))
557 dstPtr += ALT32_CORR;557 dstPtr += ALT32_CORR;
558 558
@@ -860,8 +860,8 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], · 301 unmodified lines
860 860
861void ff_get_unscaled_swscale(SwsContext *c)861void ff_get_unscaled_swscale(SwsContext *c)
862{862{
863 const enum PixelFormat srcFormat = c->srcFormat;863 const enum AVPixelFormat srcFormat = c->srcFormat;
864 const enum PixelFormat dstFormat = c->dstFormat;864 const enum AVPixelFormat dstFormat = c->dstFormat;
865 const int flags = c->flags;865 const int flags = c->flags;
866 const int dstH = c->dstH;866 const int dstH = c->dstH;
867 int needsDither;867 int needsDither;
@@ -871,26 +871,26 @@ void ff_get_unscaled_swscale(SwsContext *c) · 3 unmodified lines
871 (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat)));871 (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat)));
872 872
873 /* yv12_to_nv12 */873 /* yv12_to_nv12 */
874 if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) &&874 if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) &&
875 (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) {875 (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) {
876 c->swScale = planarToNv12Wrapper;876 c->swScale = planarToNv12Wrapper;
877 }877 }
878 /* yuv2bgr */878 /* yuv2bgr */
879 if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUV422P ||879 if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P ||
880 srcFormat == PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&880 srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&
881 !(flags & SWS_ACCURATE_RND) && !(dstH & 1)) {881 !(flags & SWS_ACCURATE_RND) && !(dstH & 1)) {
882 c->swScale = ff_yuv2rgb_get_func_ptr(c);882 c->swScale = ff_yuv2rgb_get_func_ptr(c);
883 }883 }
884 884
885 if (srcFormat == PIX_FMT_YUV410P &&885 if (srcFormat == AV_PIX_FMT_YUV410P &&
886 (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P) &&886 (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
887 !(flags & SWS_BITEXACT)) {887 !(flags & SWS_BITEXACT)) {
888 c->swScale = yvu9ToYv12Wrapper;888 c->swScale = yvu9ToYv12Wrapper;
889 }889 }
890 890
891 /* bgr24toYV12 */891 /* bgr24toYV12 */
892 if (srcFormat == PIX_FMT_BGR24 &&892 if (srcFormat == AV_PIX_FMT_BGR24 &&
893 (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P) &&893 (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
894 !(flags & SWS_ACCURATE_RND))894 !(flags & SWS_ACCURATE_RND))
895 c->swScale = bgr24ToYv12Wrapper;895 c->swScale = bgr24ToYv12Wrapper;
896 896
@@ -903,66 +903,66 @@ void ff_get_unscaled_swscale(SwsContext *c) · 6 unmodified lines
903 c->swScale = planarRgbToRgbWrapper;903 c->swScale = planarRgbToRgbWrapper;
904 904
905 /* bswap 16 bits per pixel/component packed formats */905 /* bswap 16 bits per pixel/component packed formats */
906 if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR444) ||906 if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) ||
907 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR48) ||907 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR48) ||
908 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR555) ||908 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR555) ||
909 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR565) ||909 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR565) ||
910 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_GRAY16) ||910 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) ||
911 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB444) ||911 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) ||
912 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB48) ||912 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48) ||
913 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB555) ||913 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB555) ||
914 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB565))914 IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565))
915 c->swScale = packed_16bpc_bswap;915 c->swScale = packed_16bpc_bswap;
916 916
917 if ((usePal(srcFormat) && (917 if ((usePal(srcFormat) && (
918 dstFormat == PIX_FMT_RGB32 ||918 dstFormat == AV_PIX_FMT_RGB32 ||
919 dstFormat == PIX_FMT_RGB32_1 ||919 dstFormat == AV_PIX_FMT_RGB32_1 ||
920 dstFormat == PIX_FMT_RGB24 ||920 dstFormat == AV_PIX_FMT_RGB24 ||
921 dstFormat == PIX_FMT_BGR32 ||921 dstFormat == AV_PIX_FMT_BGR32 ||
922 dstFormat == PIX_FMT_BGR32_1 ||922 dstFormat == AV_PIX_FMT_BGR32_1 ||
923 dstFormat == PIX_FMT_BGR24)))923 dstFormat == AV_PIX_FMT_BGR24)))
924 c->swScale = palToRgbWrapper;924 c->swScale = palToRgbWrapper;
925 925
926 if (srcFormat == PIX_FMT_YUV422P) {926 if (srcFormat == AV_PIX_FMT_YUV422P) {
927 if (dstFormat == PIX_FMT_YUYV422)927 if (dstFormat == AV_PIX_FMT_YUYV422)
928 c->swScale = yuv422pToYuy2Wrapper;928 c->swScale = yuv422pToYuy2Wrapper;
929 else if (dstFormat == PIX_FMT_UYVY422)929 else if (dstFormat == AV_PIX_FMT_UYVY422)
930 c->swScale = yuv422pToUyvyWrapper;930 c->swScale = yuv422pToUyvyWrapper;
931 }931 }
932 932
933 /* LQ converters if -sws 0 or -sws 4*/933 /* LQ converters if -sws 0 or -sws 4*/
934 if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) {934 if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) {
935 /* yv12_to_yuy2 */935 /* yv12_to_yuy2 */
936 if (srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) {936 if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) {
937 if (dstFormat == PIX_FMT_YUYV422)937 if (dstFormat == AV_PIX_FMT_YUYV422)
938 c->swScale = planarToYuy2Wrapper;938 c->swScale = planarToYuy2Wrapper;
939 else if (dstFormat == PIX_FMT_UYVY422)939 else if (dstFormat == AV_PIX_FMT_UYVY422)
940 c->swScale = planarToUyvyWrapper;940 c->swScale = planarToUyvyWrapper;
941 }941 }
942 }942 }
943 if (srcFormat == PIX_FMT_YUYV422 &&943 if (srcFormat == AV_PIX_FMT_YUYV422 &&
944 (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P))944 (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
945 c->swScale = yuyvToYuv420Wrapper;945 c->swScale = yuyvToYuv420Wrapper;
946 if (srcFormat == PIX_FMT_UYVY422 &&946 if (srcFormat == AV_PIX_FMT_UYVY422 &&
947 (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P))947 (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
948 c->swScale = uyvyToYuv420Wrapper;948 c->swScale = uyvyToYuv420Wrapper;
949 if (srcFormat == PIX_FMT_YUYV422 && dstFormat == PIX_FMT_YUV422P)949 if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P)
950 c->swScale = yuyvToYuv422Wrapper;950 c->swScale = yuyvToYuv422Wrapper;
951 if (srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P)951 if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P)
952 c->swScale = uyvyToYuv422Wrapper;952 c->swScale = uyvyToYuv422Wrapper;
953 953
954 /* simple copy */954 /* simple copy */
955 if ( srcFormat == dstFormat ||955 if ( srcFormat == dstFormat ||
956 (srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P) ||956 (srcFormat == AV_PIX_FMT_YUVA420P && dstFormat == AV_PIX_FMT_YUV420P) ||
957 (srcFormat == PIX_FMT_YUV420P && dstFormat == PIX_FMT_YUVA420P) ||957 (srcFormat == AV_PIX_FMT_YUV420P && dstFormat == AV_PIX_FMT_YUVA420P) ||
958 (isPlanarYUV(srcFormat) && isGray(dstFormat)) ||958 (isPlanarYUV(srcFormat) && isGray(dstFormat)) ||
959 (isPlanarYUV(dstFormat) && isGray(srcFormat)) ||959 (isPlanarYUV(dstFormat) && isGray(srcFormat)) ||
960 (isGray(dstFormat) && isGray(srcFormat)) ||960 (isGray(dstFormat) && isGray(srcFormat)) ||
961 (isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) &&961 (isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) &&
962 c->chrDstHSubSample == c->chrSrcHSubSample &&962 c->chrDstHSubSample == c->chrSrcHSubSample &&
963 c->chrDstVSubSample == c->chrSrcVSubSample &&963 c->chrDstVSubSample == c->chrSrcVSubSample &&
964 dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 &&964 dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
965 srcFormat != PIX_FMT_NV12 && srcFormat != PIX_FMT_NV21))965 srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21))
966 {966 {
967 if (isPacked(c->srcFormat))967 if (isPacked(c->srcFormat))
968 c->swScale = packedCopyWrapper;968 c->swScale = packedCopyWrapper;
@@ -988,7 +988,7 @@ static void reset_ptr(const uint8_t *src[], int format) · 19 unmodified lines
988 }988 }
989}989}
990 990
991static int check_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt,991static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt,
992 const int linesizes[4])992 const int linesizes[4])
993{993{
994 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];994 const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
@@ -1041,28 +1041,28 @@ int attribute_align_arg sws_scale(struct SwsContext *c, · 46 unmodified lines
1041 if (usePal(c->srcFormat)) {1041 if (usePal(c->srcFormat)) {
1042 for (i = 0; i < 256; i++) {1042 for (i = 0; i < 256; i++) {
1043 int p, r, g, b, y, u, v;1043 int p, r, g, b, y, u, v;
1044 if (c->srcFormat == PIX_FMT_PAL8) {1044 if (c->srcFormat == AV_PIX_FMT_PAL8) {
1045 p = ((const uint32_t *)(srcSlice[1]))[i];1045 p = ((const uint32_t *)(srcSlice[1]))[i];
1046 r = (p >> 16) & 0xFF;1046 r = (p >> 16) & 0xFF;
1047 g = (p >> 8) & 0xFF;1047 g = (p >> 8) & 0xFF;
1048 b = p & 0xFF;1048 b = p & 0xFF;
1049 } else if (c->srcFormat == PIX_FMT_RGB8) {1049 } else if (c->srcFormat == AV_PIX_FMT_RGB8) {
1050 r = ( i >> 5 ) * 36;1050 r = ( i >> 5 ) * 36;
1051 g = ((i >> 2) & 7) * 36;1051 g = ((i >> 2) & 7) * 36;
1052 b = ( i & 3) * 85;1052 b = ( i & 3) * 85;
1053 } else if (c->srcFormat == PIX_FMT_BGR8) {1053 } else if (c->srcFormat == AV_PIX_FMT_BGR8) {
1054 b = ( i >> 6 ) * 85;1054 b = ( i >> 6 ) * 85;
1055 g = ((i >> 3) & 7) * 36;1055 g = ((i >> 3) & 7) * 36;
1056 r = ( i & 7) * 36;1056 r = ( i & 7) * 36;
1057 } else if (c->srcFormat == PIX_FMT_RGB4_BYTE) {1057 } else if (c->srcFormat == AV_PIX_FMT_RGB4_BYTE) {
1058 r = ( i >> 3 ) * 255;1058 r = ( i >> 3 ) * 255;
1059 g = ((i >> 1) & 3) * 85;1059 g = ((i >> 1) & 3) * 85;
1060 b = ( i & 1) * 255;1060 b = ( i & 1) * 255;
1061 } else if (c->srcFormat == PIX_FMT_GRAY8 ||1061 } else if (c->srcFormat == AV_PIX_FMT_GRAY8 ||
1062 c->srcFormat == PIX_FMT_Y400A) {1062 c->srcFormat == AV_PIX_FMT_Y400A) {
1063 r = g = b = i;1063 r = g = b = i;
1064 } else {1064 } else {
1065 assert(c->srcFormat == PIX_FMT_BGR4_BYTE);1065 assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);
1066 b = ( i >> 3 ) * 255;1066 b = ( i >> 3 ) * 255;
1067 g = ((i >> 1) & 3) * 85;1067 g = ((i >> 1) & 3) * 85;
1068 r = ( i & 1) * 255;1068 r = ( i & 1) * 255;
@@ -1073,27 +1073,27 @@ int attribute_align_arg sws_scale(struct SwsContext *c, · 4 unmodified lines
1073 c->pal_yuv[i] = y + (u << 8) + (v << 16);1073 c->pal_yuv[i] = y + (u << 8) + (v << 16);
1074 1074
1075 switch (c->dstFormat) {1075 switch (c->dstFormat) {
1076 case PIX_FMT_BGR32:1076 case AV_PIX_FMT_BGR32:
1077#if !HAVE_BIGENDIAN1077#if !HAVE_BIGENDIAN
1078 case PIX_FMT_RGB24:1078 case AV_PIX_FMT_RGB24:
1079#endif1079#endif
1080 c->pal_rgb[i] = r + (g << 8) + (b << 16);1080 c->pal_rgb[i] = r + (g << 8) + (b << 16);
1081 break;1081 break;
1082 case PIX_FMT_BGR32_1:1082 case AV_PIX_FMT_BGR32_1:
1083#if HAVE_BIGENDIAN1083#if HAVE_BIGENDIAN
1084 case PIX_FMT_BGR24:1084 case AV_PIX_FMT_BGR24:
1085#endif1085#endif
1086 c->pal_rgb[i] = (r + (g << 8) + (b << 16)) << 8;1086 c->pal_rgb[i] = (r + (g << 8) + (b << 16)) << 8;
1087 break;1087 break;
1088 case PIX_FMT_RGB32_1:1088 case AV_PIX_FMT_RGB32_1:
1089#if HAVE_BIGENDIAN1089#if HAVE_BIGENDIAN
1090 case PIX_FMT_RGB24:1090 case AV_PIX_FMT_RGB24:
1091#endif1091#endif
1092 c->pal_rgb[i] = (b + (g << 8) + (r << 16)) << 8;1092 c->pal_rgb[i] = (b + (g << 8) + (r << 16)) << 8;
1093 break;1093 break;
1094 case PIX_FMT_RGB32:1094 case AV_PIX_FMT_RGB32:
1095#if !HAVE_BIGENDIAN1095#if !HAVE_BIGENDIAN
1096 case PIX_FMT_BGR24:1096 case AV_PIX_FMT_BGR24:
1097#endif1097#endif
1098 default:1098 default:
1099 c->pal_rgb[i] = b + (g << 8) + (r << 16);1099 c->pal_rgb[i] = b + (g << 8) + (r << 16);
libswscale/utils.c+111−111
@@ -73,102 +73,102 @@ typedef struct FormatEntry { · 72 unmodified lines
73 int is_supported_in, is_supported_out;73 int is_supported_in, is_supported_out;
74} FormatEntry;74} FormatEntry;
75 75
76static const FormatEntry format_entries[PIX_FMT_NB] = {76static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
77 [PIX_FMT_YUV420P] = { 1, 1 },77 [AV_PIX_FMT_YUV420P] = { 1, 1 },
78 [PIX_FMT_YUYV422] = { 1, 1 },78 [AV_PIX_FMT_YUYV422] = { 1, 1 },
79 [PIX_FMT_RGB24] = { 1, 1 },79 [AV_PIX_FMT_RGB24] = { 1, 1 },
80 [PIX_FMT_BGR24] = { 1, 1 },80 [AV_PIX_FMT_BGR24] = { 1, 1 },
81 [PIX_FMT_YUV422P] = { 1, 1 },81 [AV_PIX_FMT_YUV422P] = { 1, 1 },
82 [PIX_FMT_YUV444P] = { 1, 1 },82 [AV_PIX_FMT_YUV444P] = { 1, 1 },
83 [PIX_FMT_YUV410P] = { 1, 1 },83 [AV_PIX_FMT_YUV410P] = { 1, 1 },
84 [PIX_FMT_YUV411P] = { 1, 1 },84 [AV_PIX_FMT_YUV411P] = { 1, 1 },
85 [PIX_FMT_GRAY8] = { 1, 1 },85 [AV_PIX_FMT_GRAY8] = { 1, 1 },
86 [PIX_FMT_MONOWHITE] = { 1, 1 },86 [AV_PIX_FMT_MONOWHITE] = { 1, 1 },
87 [PIX_FMT_MONOBLACK] = { 1, 1 },87 [AV_PIX_FMT_MONOBLACK] = { 1, 1 },
88 [PIX_FMT_PAL8] = { 1, 0 },88 [AV_PIX_FMT_PAL8] = { 1, 0 },
89 [PIX_FMT_YUVJ420P] = { 1, 1 },89 [AV_PIX_FMT_YUVJ420P] = { 1, 1 },
90 [PIX_FMT_YUVJ422P] = { 1, 1 },90 [AV_PIX_FMT_YUVJ422P] = { 1, 1 },
91 [PIX_FMT_YUVJ444P] = { 1, 1 },91 [AV_PIX_FMT_YUVJ444P] = { 1, 1 },
92 [PIX_FMT_UYVY422] = { 1, 1 },92 [AV_PIX_FMT_UYVY422] = { 1, 1 },
93 [PIX_FMT_UYYVYY411] = { 0, 0 },93 [AV_PIX_FMT_UYYVYY411] = { 0, 0 },
94 [PIX_FMT_BGR8] = { 1, 1 },94 [AV_PIX_FMT_BGR8] = { 1, 1 },
95 [PIX_FMT_BGR4] = { 0, 1 },95 [AV_PIX_FMT_BGR4] = { 0, 1 },
96 [PIX_FMT_BGR4_BYTE] = { 1, 1 },96 [AV_PIX_FMT_BGR4_BYTE] = { 1, 1 },
97 [PIX_FMT_RGB8] = { 1, 1 },97 [AV_PIX_FMT_RGB8] = { 1, 1 },
98 [PIX_FMT_RGB4] = { 0, 1 },98 [AV_PIX_FMT_RGB4] = { 0, 1 },
99 [PIX_FMT_RGB4_BYTE] = { 1, 1 },99 [AV_PIX_FMT_RGB4_BYTE] = { 1, 1 },
100 [PIX_FMT_NV12] = { 1, 1 },100 [AV_PIX_FMT_NV12] = { 1, 1 },
101 [PIX_FMT_NV21] = { 1, 1 },101 [AV_PIX_FMT_NV21] = { 1, 1 },
102 [PIX_FMT_ARGB] = { 1, 1 },102 [AV_PIX_FMT_ARGB] = { 1, 1 },
103 [PIX_FMT_RGBA] = { 1, 1 },103 [AV_PIX_FMT_RGBA] = { 1, 1 },
104 [PIX_FMT_ABGR] = { 1, 1 },104 [AV_PIX_FMT_ABGR] = { 1, 1 },
105 [PIX_FMT_BGRA] = { 1, 1 },105 [AV_PIX_FMT_BGRA] = { 1, 1 },
106 [PIX_FMT_GRAY16BE] = { 1, 1 },106 [AV_PIX_FMT_GRAY16BE] = { 1, 1 },
107 [PIX_FMT_GRAY16LE] = { 1, 1 },107 [AV_PIX_FMT_GRAY16LE] = { 1, 1 },
108 [PIX_FMT_YUV440P] = { 1, 1 },108 [AV_PIX_FMT_YUV440P] = { 1, 1 },
109 [PIX_FMT_YUVJ440P] = { 1, 1 },109 [AV_PIX_FMT_YUVJ440P] = { 1, 1 },
110 [PIX_FMT_YUVA420P] = { 1, 1 },110 [AV_PIX_FMT_YUVA420P] = { 1, 1 },
111 [PIX_FMT_RGB48BE] = { 1, 1 },111 [AV_PIX_FMT_RGB48BE] = { 1, 1 },
112 [PIX_FMT_RGB48LE] = { 1, 1 },112 [AV_PIX_FMT_RGB48LE] = { 1, 1 },
113 [PIX_FMT_RGB565BE] = { 1, 1 },113 [AV_PIX_FMT_RGB565BE] = { 1, 1 },
114 [PIX_FMT_RGB565LE] = { 1, 1 },114 [AV_PIX_FMT_RGB565LE] = { 1, 1 },
115 [PIX_FMT_RGB555BE] = { 1, 1 },115 [AV_PIX_FMT_RGB555BE] = { 1, 1 },
116 [PIX_FMT_RGB555LE] = { 1, 1 },116 [AV_PIX_FMT_RGB555LE] = { 1, 1 },
117 [PIX_FMT_BGR565BE] = { 1, 1 },117 [AV_PIX_FMT_BGR565BE] = { 1, 1 },
118 [PIX_FMT_BGR565LE] = { 1, 1 },118 [AV_PIX_FMT_BGR565LE] = { 1, 1 },
119 [PIX_FMT_BGR555BE] = { 1, 1 },119 [AV_PIX_FMT_BGR555BE] = { 1, 1 },
120 [PIX_FMT_BGR555LE] = { 1, 1 },120 [AV_PIX_FMT_BGR555LE] = { 1, 1 },
121 [PIX_FMT_YUV420P16LE] = { 1, 1 },121 [AV_PIX_FMT_YUV420P16LE] = { 1, 1 },
122 [PIX_FMT_YUV420P16BE] = { 1, 1 },122 [AV_PIX_FMT_YUV420P16BE] = { 1, 1 },
123 [PIX_FMT_YUV422P16LE] = { 1, 1 },123 [AV_PIX_FMT_YUV422P16LE] = { 1, 1 },
124 [PIX_FMT_YUV422P16BE] = { 1, 1 },124 [AV_PIX_FMT_YUV422P16BE] = { 1, 1 },
125 [PIX_FMT_YUV444P16LE] = { 1, 1 },125 [AV_PIX_FMT_YUV444P16LE] = { 1, 1 },
126 [PIX_FMT_YUV444P16BE] = { 1, 1 },126 [AV_PIX_FMT_YUV444P16BE] = { 1, 1 },
127 [PIX_FMT_RGB444LE] = { 1, 1 },127 [AV_PIX_FMT_RGB444LE] = { 1, 1 },
128 [PIX_FMT_RGB444BE] = { 1, 1 },128 [AV_PIX_FMT_RGB444BE] = { 1, 1 },
129 [PIX_FMT_BGR444LE] = { 1, 1 },129 [AV_PIX_FMT_BGR444LE] = { 1, 1 },
130 [PIX_FMT_BGR444BE] = { 1, 1 },130 [AV_PIX_FMT_BGR444BE] = { 1, 1 },
131 [PIX_FMT_Y400A] = { 1, 0 },131 [AV_PIX_FMT_Y400A] = { 1, 0 },
132 [PIX_FMT_BGR48BE] = { 1, 1 },132 [AV_PIX_FMT_BGR48BE] = { 1, 1 },
133 [PIX_FMT_BGR48LE] = { 1, 1 },133 [AV_PIX_FMT_BGR48LE] = { 1, 1 },
134 [PIX_FMT_YUV420P9BE] = { 1, 1 },134 [AV_PIX_FMT_YUV420P9BE] = { 1, 1 },
135 [PIX_FMT_YUV420P9LE] = { 1, 1 },135 [AV_PIX_FMT_YUV420P9LE] = { 1, 1 },
136 [PIX_FMT_YUV420P10BE] = { 1, 1 },136 [AV_PIX_FMT_YUV420P10BE] = { 1, 1 },
137 [PIX_FMT_YUV420P10LE] = { 1, 1 },137 [AV_PIX_FMT_YUV420P10LE] = { 1, 1 },
138 [PIX_FMT_YUV422P9BE] = { 1, 1 },138 [AV_PIX_FMT_YUV422P9BE] = { 1, 1 },
139 [PIX_FMT_YUV422P9LE] = { 1, 1 },139 [AV_PIX_FMT_YUV422P9LE] = { 1, 1 },
140 [PIX_FMT_YUV422P10BE] = { 1, 1 },140 [AV_PIX_FMT_YUV422P10BE] = { 1, 1 },
141 [PIX_FMT_YUV422P10LE] = { 1, 1 },141 [AV_PIX_FMT_YUV422P10LE] = { 1, 1 },
142 [PIX_FMT_YUV444P9BE] = { 1, 1 },142 [AV_PIX_FMT_YUV444P9BE] = { 1, 1 },
143 [PIX_FMT_YUV444P9LE] = { 1, 1 },143 [AV_PIX_FMT_YUV444P9LE] = { 1, 1 },
144 [PIX_FMT_YUV444P10BE] = { 1, 1 },144 [AV_PIX_FMT_YUV444P10BE] = { 1, 1 },
145 [PIX_FMT_YUV444P10LE] = { 1, 1 },145 [AV_PIX_FMT_YUV444P10LE] = { 1, 1 },
146 [PIX_FMT_GBRP] = { 1, 0 },146 [AV_PIX_FMT_GBRP] = { 1, 0 },
147 [PIX_FMT_GBRP9LE] = { 1, 0 },147 [AV_PIX_FMT_GBRP9LE] = { 1, 0 },
148 [PIX_FMT_GBRP9BE] = { 1, 0 },148 [AV_PIX_FMT_GBRP9BE] = { 1, 0 },
149 [PIX_FMT_GBRP10LE] = { 1, 0 },149 [AV_PIX_FMT_GBRP10LE] = { 1, 0 },
150 [PIX_FMT_GBRP10BE] = { 1, 0 },150 [AV_PIX_FMT_GBRP10BE] = { 1, 0 },
151 [PIX_FMT_GBRP16LE] = { 1, 0 },151 [AV_PIX_FMT_GBRP16LE] = { 1, 0 },
152 [PIX_FMT_GBRP16BE] = { 1, 0 },152 [AV_PIX_FMT_GBRP16BE] = { 1, 0 },
153};153};
154 154
155int sws_isSupportedInput(enum PixelFormat pix_fmt)155int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
156{156{
157 return (unsigned)pix_fmt < PIX_FMT_NB ?157 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
158 format_entries[pix_fmt].is_supported_in : 0;158 format_entries[pix_fmt].is_supported_in : 0;
159}159}
160 160
161int sws_isSupportedOutput(enum PixelFormat pix_fmt)161int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
162{162{
163 return (unsigned)pix_fmt < PIX_FMT_NB ?163 return (unsigned)pix_fmt < AV_PIX_FMT_NB ?
164 format_entries[pix_fmt].is_supported_out : 0;164 format_entries[pix_fmt].is_supported_out : 0;
165}165}
166 166
167extern const int32_t ff_yuv2rgb_coeffs[8][4];167extern const int32_t ff_yuv2rgb_coeffs[8][4];
168 168
169const char *sws_format_name(enum PixelFormat format)169const char *sws_format_name(enum AVPixelFormat format)
170{170{
171 if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name)171 if ((unsigned)format < AV_PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
172 return av_pix_fmt_descriptors[format].name;172 return av_pix_fmt_descriptors[format].name;
173 else173 else
174 return "Unknown format";174 return "Unknown format";
@@ -743,7 +743,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, · 568 unmodified lines
743}743}
744#endif /* HAVE_MMXEXT_INLINE */744#endif /* HAVE_MMXEXT_INLINE */
745 745
746static void getSubSampleFactors(int *h, int *v, enum PixelFormat format)746static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
747{747{
748 *h = av_pix_fmt_descriptors[format].log2_chroma_w;748 *h = av_pix_fmt_descriptors[format].log2_chroma_w;
749 *v = av_pix_fmt_descriptors[format].log2_chroma_h;749 *v = av_pix_fmt_descriptors[format].log2_chroma_h;
@@ -795,20 +795,20 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, · 45 unmodified lines
795 return 0;795 return 0;
796}796}
797 797
798static int handle_jpeg(enum PixelFormat *format)798static int handle_jpeg(enum AVPixelFormat *format)
799{799{
800 switch (*format) {800 switch (*format) {
801 case PIX_FMT_YUVJ420P:801 case AV_PIX_FMT_YUVJ420P:
802 *format = PIX_FMT_YUV420P;802 *format = AV_PIX_FMT_YUV420P;
803 return 1;803 return 1;
804 case PIX_FMT_YUVJ422P:804 case AV_PIX_FMT_YUVJ422P:
805 *format = PIX_FMT_YUV422P;805 *format = AV_PIX_FMT_YUV422P;
806 return 1;806 return 1;
807 case PIX_FMT_YUVJ444P:807 case AV_PIX_FMT_YUVJ444P:
808 *format = PIX_FMT_YUV444P;808 *format = AV_PIX_FMT_YUV444P;
809 return 1;809 return 1;
810 case PIX_FMT_YUVJ440P:810 case AV_PIX_FMT_YUVJ440P:
811 *format = PIX_FMT_YUV440P;811 *format = AV_PIX_FMT_YUV440P;
812 return 1;812 return 1;
813 default:813 default:
814 return 0;814 return 0;
@@ -839,8 +839,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, · 24 unmodified lines
839 int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 16, 16);839 int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 16, 16);
840 int dst_stride_px = dst_stride >> 1;840 int dst_stride_px = dst_stride >> 1;
841 int flags, cpu_flags;841 int flags, cpu_flags;
842 enum PixelFormat srcFormat = c->srcFormat;842 enum AVPixelFormat srcFormat = c->srcFormat;
843 enum PixelFormat dstFormat = c->dstFormat;843 enum AVPixelFormat dstFormat = c->dstFormat;
844 844
845 cpu_flags = av_get_cpu_flags();845 cpu_flags = av_get_cpu_flags();
846 flags = c->flags;846 flags = c->flags;
@@ -913,12 +913,12 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, · 66 unmodified lines
913 * chroma interpolation */913 * chroma interpolation */
914 if (flags & SWS_FULL_CHR_H_INT &&914 if (flags & SWS_FULL_CHR_H_INT &&
915 isAnyRGB(dstFormat) &&915 isAnyRGB(dstFormat) &&
916 dstFormat != PIX_FMT_RGBA &&916 dstFormat != AV_PIX_FMT_RGBA &&
917 dstFormat != PIX_FMT_ARGB &&917 dstFormat != AV_PIX_FMT_ARGB &&
918 dstFormat != PIX_FMT_BGRA &&918 dstFormat != AV_PIX_FMT_BGRA &&
919 dstFormat != PIX_FMT_ABGR &&919 dstFormat != AV_PIX_FMT_ABGR &&
920 dstFormat != PIX_FMT_RGB24 &&920 dstFormat != AV_PIX_FMT_RGB24 &&
921 dstFormat != PIX_FMT_BGR24) {921 dstFormat != AV_PIX_FMT_BGR24) {
922 av_log(c, AV_LOG_ERROR,922 av_log(c, AV_LOG_ERROR,
923 "full chroma interpolation for destination format '%s' not yet implemented\n",923 "full chroma interpolation for destination format '%s' not yet implemented\n",
924 sws_format_name(dstFormat));924 sws_format_name(dstFormat));
@@ -936,9 +936,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, · 11 unmodified lines
936 /* drop every other pixel for chroma calculation unless user936 /* drop every other pixel for chroma calculation unless user
937 * wants full chroma */937 * wants full chroma */
938 if (isAnyRGB(srcFormat) && !(flags & SWS_FULL_CHR_H_INP) &&938 if (isAnyRGB(srcFormat) && !(flags & SWS_FULL_CHR_H_INP) &&
939 srcFormat != PIX_FMT_RGB8 && srcFormat != PIX_FMT_BGR8 &&939 srcFormat != AV_PIX_FMT_RGB8 && srcFormat != AV_PIX_FMT_BGR8 &&
940 srcFormat != PIX_FMT_RGB4 && srcFormat != PIX_FMT_BGR4 &&940 srcFormat != AV_PIX_FMT_RGB4 && srcFormat != AV_PIX_FMT_BGR4 &&
941 srcFormat != PIX_FMT_RGB4_BYTE && srcFormat != PIX_FMT_BGR4_BYTE &&941 srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE &&
942 ((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||942 ((dstW >> c->chrDstHSubSample) <= (srcW >> 1) ||
943 (flags & SWS_FAST_BILINEAR)))943 (flags & SWS_FAST_BILINEAR)))
944 c->chrSrcHSubSample = 1;944 c->chrSrcHSubSample = 1;
@@ -1199,9 +1199,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, · 254 unmodified lines
1199 av_log(c, AV_LOG_INFO, "from %s to %s%s ",1199 av_log(c, AV_LOG_INFO, "from %s to %s%s ",
1200 sws_format_name(srcFormat),1200 sws_format_name(srcFormat),
1201#ifdef DITHER1XBPP1201#ifdef DITHER1XBPP
1202 dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ||1202 dstFormat == AV_PIX_FMT_BGR555 || dstFormat == AV_PIX_FMT_BGR565 ||
1203 dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE ||1203 dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE ||
1204 dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ?1204 dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ?
1205 "dithered " : "",1205 "dithered " : "",
1206#else1206#else
1207 "",1207 "",
@@ -1236,8 +1236,8 @@ fail: // FIXME replace things by appropriate error codes · 28 unmodified lines
1236}1236}
1237 1237
1238#if FF_API_SWS_GETCONTEXT1238#if FF_API_SWS_GETCONTEXT
1239SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,1239SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
1240 int dstW, int dstH, enum PixelFormat dstFormat,1240 int dstW, int dstH, enum AVPixelFormat dstFormat,
1241 int flags, SwsFilter *srcFilter,1241 int flags, SwsFilter *srcFilter,
1242 SwsFilter *dstFilter, const double *param)1242 SwsFilter *dstFilter, const double *param)
1243{1243{
@@ -1647,9 +1647,9 @@ void sws_freeContext(SwsContext *c) · 403 unmodified lines
1647}1647}
1648 1648
1649struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW,1649struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW,
1650 int srcH, enum PixelFormat srcFormat,1650 int srcH, enum AVPixelFormat srcFormat,
1651 int dstW, int dstH,1651 int dstW, int dstH,
1652 enum PixelFormat dstFormat, int flags,1652 enum AVPixelFormat dstFormat, int flags,
1653 SwsFilter *srcFilter,1653 SwsFilter *srcFilter,
1654 SwsFilter *dstFilter,1654 SwsFilter *dstFilter,
1655 const double *param)1655 const double *param)
libswscale/x86/swscale.c+16−16
@@ -111,7 +111,7 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI · 110 unmodified lines
111 const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input111 const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
112 112
113 c->blueDither= ff_dither8[dstY&1];113 c->blueDither= ff_dither8[dstY&1];
114 if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555)114 if (c->dstFormat == AV_PIX_FMT_RGB555 || c->dstFormat == AV_PIX_FMT_BGR555)
115 c->greenDither= ff_dither8[dstY&1];115 c->greenDither= ff_dither8[dstY&1];
116 else116 else
117 c->greenDither= ff_dither4[dstY&1];117 c->greenDither= ff_dither4[dstY&1];
@@ -351,7 +351,7 @@ switch(c->dstBpc){ \ · 233 unmodified lines
351 default: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \351 default: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \
352 }352 }
353#define case_rgb(x, X, opt) \353#define case_rgb(x, X, opt) \
354 case PIX_FMT_ ## X: \354 case AV_PIX_FMT_ ## X: \
355 c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \355 c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \
356 if (!c->chrSrcHSubSample) \356 if (!c->chrSrcHSubSample) \
357 c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \357 c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \
@@ -363,23 +363,23 @@ switch(c->dstBpc){ \ · 5 unmodified lines
363 ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMXEXT);363 ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMXEXT);
364 364
365 switch (c->srcFormat) {365 switch (c->srcFormat) {
366 case PIX_FMT_Y400A:366 case AV_PIX_FMT_Y400A:
367 c->lumToYV12 = ff_yuyvToY_mmx;367 c->lumToYV12 = ff_yuyvToY_mmx;
368 if (c->alpPixBuf)368 if (c->alpPixBuf)
369 c->alpToYV12 = ff_uyvyToY_mmx;369 c->alpToYV12 = ff_uyvyToY_mmx;
370 break;370 break;
371 case PIX_FMT_YUYV422:371 case AV_PIX_FMT_YUYV422:
372 c->lumToYV12 = ff_yuyvToY_mmx;372 c->lumToYV12 = ff_yuyvToY_mmx;
373 c->chrToYV12 = ff_yuyvToUV_mmx;373 c->chrToYV12 = ff_yuyvToUV_mmx;
374 break;374 break;
375 case PIX_FMT_UYVY422:375 case AV_PIX_FMT_UYVY422:
376 c->lumToYV12 = ff_uyvyToY_mmx;376 c->lumToYV12 = ff_uyvyToY_mmx;
377 c->chrToYV12 = ff_uyvyToUV_mmx;377 c->chrToYV12 = ff_uyvyToUV_mmx;
378 break;378 break;
379 case PIX_FMT_NV12:379 case AV_PIX_FMT_NV12:
380 c->chrToYV12 = ff_nv12ToUV_mmx;380 c->chrToYV12 = ff_nv12ToUV_mmx;
381 break;381 break;
382 case PIX_FMT_NV21:382 case AV_PIX_FMT_NV21:
383 c->chrToYV12 = ff_nv21ToUV_mmx;383 c->chrToYV12 = ff_nv21ToUV_mmx;
384 break;384 break;
385 case_rgb(rgb24, RGB24, mmx);385 case_rgb(rgb24, RGB24, mmx);
@@ -412,23 +412,23 @@ switch(c->dstBpc){ \ · 26 unmodified lines
412 ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1);412 ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1);
413 413
414 switch (c->srcFormat) {414 switch (c->srcFormat) {
415 case PIX_FMT_Y400A:415 case AV_PIX_FMT_Y400A:
416 c->lumToYV12 = ff_yuyvToY_sse2;416 c->lumToYV12 = ff_yuyvToY_sse2;
417 if (c->alpPixBuf)417 if (c->alpPixBuf)
418 c->alpToYV12 = ff_uyvyToY_sse2;418 c->alpToYV12 = ff_uyvyToY_sse2;
419 break;419 break;
420 case PIX_FMT_YUYV422:420 case AV_PIX_FMT_YUYV422:
421 c->lumToYV12 = ff_yuyvToY_sse2;421 c->lumToYV12 = ff_yuyvToY_sse2;
422 c->chrToYV12 = ff_yuyvToUV_sse2;422 c->chrToYV12 = ff_yuyvToUV_sse2;
423 break;423 break;
424 case PIX_FMT_UYVY422:424 case AV_PIX_FMT_UYVY422:
425 c->lumToYV12 = ff_uyvyToY_sse2;425 c->lumToYV12 = ff_uyvyToY_sse2;
426 c->chrToYV12 = ff_uyvyToUV_sse2;426 c->chrToYV12 = ff_uyvyToUV_sse2;
427 break;427 break;
428 case PIX_FMT_NV12:428 case AV_PIX_FMT_NV12:
429 c->chrToYV12 = ff_nv12ToUV_sse2;429 c->chrToYV12 = ff_nv12ToUV_sse2;
430 break;430 break;
431 case PIX_FMT_NV21:431 case AV_PIX_FMT_NV21:
432 c->chrToYV12 = ff_nv21ToUV_sse2;432 c->chrToYV12 = ff_nv21ToUV_sse2;
433 break;433 break;
434 case_rgb(rgb24, RGB24, sse2);434 case_rgb(rgb24, RGB24, sse2);
@@ -468,16 +468,16 @@ switch(c->dstBpc){ \ · 33 unmodified lines
468 ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1);468 ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1);
469 469
470 switch (c->srcFormat) {470 switch (c->srcFormat) {
471 case PIX_FMT_YUYV422:471 case AV_PIX_FMT_YUYV422:
472 c->chrToYV12 = ff_yuyvToUV_avx;472 c->chrToYV12 = ff_yuyvToUV_avx;
473 break;473 break;
474 case PIX_FMT_UYVY422:474 case AV_PIX_FMT_UYVY422:
475 c->chrToYV12 = ff_uyvyToUV_avx;475 c->chrToYV12 = ff_uyvyToUV_avx;
476 break;476 break;
477 case PIX_FMT_NV12:477 case AV_PIX_FMT_NV12:
478 c->chrToYV12 = ff_nv12ToUV_avx;478 c->chrToYV12 = ff_nv12ToUV_avx;
479 break;479 break;
480 case PIX_FMT_NV21:480 case AV_PIX_FMT_NV21:
481 c->chrToYV12 = ff_nv21ToUV_avx;481 c->chrToYV12 = ff_nv21ToUV_avx;
482 break;482 break;
483 case_rgb(rgb24, RGB24, avx);483 case_rgb(rgb24, RGB24, avx);
libswscale/x86/swscale_template.c+17−17
@@ -1557,30 +1557,30 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, · 1556 unmodified lines
1557 1557
1558static av_cold void RENAME(sws_init_swScale)(SwsContext *c)1558static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
1559{1559{
1560 enum PixelFormat dstFormat = c->dstFormat;1560 enum AVPixelFormat dstFormat = c->dstFormat;
1561 1561
1562 if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&1562 if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
1563 dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21) {1563 dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21) {
1564 if (!(c->flags & SWS_BITEXACT)) {1564 if (!(c->flags & SWS_BITEXACT)) {
1565 if (c->flags & SWS_ACCURATE_RND) {1565 if (c->flags & SWS_ACCURATE_RND) {
1566 if (!(c->flags & SWS_FULL_CHR_H_INT)) {1566 if (!(c->flags & SWS_FULL_CHR_H_INT)) {
1567 switch (c->dstFormat) {1567 switch (c->dstFormat) {
1568 case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;1568 case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
1569 case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;1569 case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
1570 case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;1570 case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
1571 case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;1571 case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
1572 case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;1572 case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
1573 default: break;1573 default: break;
1574 }1574 }
1575 }1575 }
1576 } else {1576 } else {
1577 if (!(c->flags & SWS_FULL_CHR_H_INT)) {1577 if (!(c->flags & SWS_FULL_CHR_H_INT)) {
1578 switch (c->dstFormat) {1578 switch (c->dstFormat) {
1579 case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;1579 case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
1580 case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;1580 case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
1581 case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;1581 case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
1582 case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;1582 case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
1583 case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;1583 case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
1584 default: break;1584 default: break;
1585 }1585 }
1586 }1586 }
@@ -1588,23 +1588,23 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) · 1 unmodified line
1588 }1588 }
1589 if (!(c->flags & SWS_FULL_CHR_H_INT)) {1589 if (!(c->flags & SWS_FULL_CHR_H_INT)) {
1590 switch (c->dstFormat) {1590 switch (c->dstFormat) {
1591 case PIX_FMT_RGB32:1591 case AV_PIX_FMT_RGB32:
1592 c->yuv2packed1 = RENAME(yuv2rgb32_1);1592 c->yuv2packed1 = RENAME(yuv2rgb32_1);
1593 c->yuv2packed2 = RENAME(yuv2rgb32_2);1593 c->yuv2packed2 = RENAME(yuv2rgb32_2);
1594 break;1594 break;
1595 case PIX_FMT_BGR24:1595 case AV_PIX_FMT_BGR24:
1596 c->yuv2packed1 = RENAME(yuv2bgr24_1);1596 c->yuv2packed1 = RENAME(yuv2bgr24_1);
1597 c->yuv2packed2 = RENAME(yuv2bgr24_2);1597 c->yuv2packed2 = RENAME(yuv2bgr24_2);
1598 break;1598 break;
1599 case PIX_FMT_RGB555:1599 case AV_PIX_FMT_RGB555:
1600 c->yuv2packed1 = RENAME(yuv2rgb555_1);1600 c->yuv2packed1 = RENAME(yuv2rgb555_1);
1601 c->yuv2packed2 = RENAME(yuv2rgb555_2);1601 c->yuv2packed2 = RENAME(yuv2rgb555_2);
1602 break;1602 break;
1603 case PIX_FMT_RGB565:1603 case AV_PIX_FMT_RGB565:
1604 c->yuv2packed1 = RENAME(yuv2rgb565_1);1604 c->yuv2packed1 = RENAME(yuv2rgb565_1);
1605 c->yuv2packed2 = RENAME(yuv2rgb565_2);1605 c->yuv2packed2 = RENAME(yuv2rgb565_2);
1606 break;1606 break;
1607 case PIX_FMT_YUYV422:1607 case AV_PIX_FMT_YUYV422:
1608 c->yuv2packed1 = RENAME(yuv2yuyv422_1);1608 c->yuv2packed1 = RENAME(yuv2yuyv422_1);
1609 c->yuv2packed2 = RENAME(yuv2yuyv422_2);1609 c->yuv2packed2 = RENAME(yuv2yuyv422_2);
1610 break;1610 break;
libswscale/x86/yuv2rgb.c+12−12
@@ -74,39 +74,39 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) · 73 unmodified lines
74#if HAVE_INLINE_ASM74#if HAVE_INLINE_ASM
75 int cpu_flags = av_get_cpu_flags();75 int cpu_flags = av_get_cpu_flags();
76 76
77 if (c->srcFormat != PIX_FMT_YUV420P &&77 if (c->srcFormat != AV_PIX_FMT_YUV420P &&
78 c->srcFormat != PIX_FMT_YUVA420P)78 c->srcFormat != AV_PIX_FMT_YUVA420P)
79 return NULL;79 return NULL;
80 80
81#if HAVE_MMXEXT_INLINE81#if HAVE_MMXEXT_INLINE
82 if (cpu_flags & AV_CPU_FLAG_MMXEXT) {82 if (cpu_flags & AV_CPU_FLAG_MMXEXT) {
83 switch (c->dstFormat) {83 switch (c->dstFormat) {
84 case PIX_FMT_RGB24: return yuv420_rgb24_MMX2;84 case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX2;
85 case PIX_FMT_BGR24: return yuv420_bgr24_MMX2;85 case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX2;
86 }86 }
87 }87 }
88#endif88#endif
89 89
90 if (cpu_flags & AV_CPU_FLAG_MMX) {90 if (cpu_flags & AV_CPU_FLAG_MMX) {
91 switch (c->dstFormat) {91 switch (c->dstFormat) {
92 case PIX_FMT_RGB32:92 case AV_PIX_FMT_RGB32:
93 if (c->srcFormat == PIX_FMT_YUVA420P) {93 if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
94#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA94#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
95 return yuva420_rgb32_MMX;95 return yuva420_rgb32_MMX;
96#endif96#endif
97 break;97 break;
98 } else return yuv420_rgb32_MMX;98 } else return yuv420_rgb32_MMX;
99 case PIX_FMT_BGR32:99 case AV_PIX_FMT_BGR32:
100 if (c->srcFormat == PIX_FMT_YUVA420P) {100 if (c->srcFormat == AV_PIX_FMT_YUVA420P) {
101#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA101#if HAVE_7REGS && CONFIG_SWSCALE_ALPHA
102 return yuva420_bgr32_MMX;102 return yuva420_bgr32_MMX;
103#endif103#endif
104 break;104 break;
105 } else return yuv420_bgr32_MMX;105 } else return yuv420_bgr32_MMX;
106 case PIX_FMT_RGB24: return yuv420_rgb24_MMX;106 case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX;
107 case PIX_FMT_BGR24: return yuv420_bgr24_MMX;107 case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX;
108 case PIX_FMT_RGB565: return yuv420_rgb16_MMX;108 case AV_PIX_FMT_RGB565: return yuv420_rgb16_MMX;
109 case PIX_FMT_RGB555: return yuv420_rgb15_MMX;109 case AV_PIX_FMT_RGB555: return yuv420_rgb15_MMX;
110 }110 }
111 }111 }
112#endif /* HAVE_INLINE_ASM */112#endif /* HAVE_INLINE_ASM */
libswscale/x86/yuv2rgb_template.c+1−1
@@ -43,7 +43,7 @@ · 42 unmodified lines
43 if (h_size * depth > FFABS(dstStride[0])) \43 if (h_size * depth > FFABS(dstStride[0])) \
44 h_size -= 8; \44 h_size -= 8; \
45 \45 \
46 if (c->srcFormat == PIX_FMT_YUV422P) { \46 if (c->srcFormat == AV_PIX_FMT_YUV422P) { \
47 srcStride[1] *= 2; \47 srcStride[1] *= 2; \
48 srcStride[2] *= 2; \48 srcStride[2] *= 2; \
49 } \49 } \
libswscale/yuv2rgb.c+47−47
@@ -124,7 +124,7 @@ const int *sws_getCoefficients(int colorspace) · 123 unmodified lines
124 { \124 { \
125 int y; \125 int y; \
126 \126 \
127 if (!alpha && c->srcFormat == PIX_FMT_YUV422P) { \127 if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \
128 srcStride[1] *= 2; \128 srcStride[1] *= 2; \
129 srcStride[2] *= 2; \129 srcStride[2] *= 2; \
130 } \130 } \
@@ -582,44 +582,44 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) · 451 unmodified lines
582 sws_format_name(c->srcFormat), sws_format_name(c->dstFormat));582 sws_format_name(c->srcFormat), sws_format_name(c->dstFormat));
583 583
584 switch (c->dstFormat) {584 switch (c->dstFormat) {
585 case PIX_FMT_BGR48BE:585 case AV_PIX_FMT_BGR48BE:
586 case PIX_FMT_BGR48LE:586 case AV_PIX_FMT_BGR48LE:
587 return yuv2rgb_c_bgr48;587 return yuv2rgb_c_bgr48;
588 case PIX_FMT_RGB48BE:588 case AV_PIX_FMT_RGB48BE:
589 case PIX_FMT_RGB48LE:589 case AV_PIX_FMT_RGB48LE:
590 return yuv2rgb_c_48;590 return yuv2rgb_c_48;
591 case PIX_FMT_ARGB:591 case AV_PIX_FMT_ARGB:
592 case PIX_FMT_ABGR:592 case AV_PIX_FMT_ABGR:
593 if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P)593 if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P)
594 return yuva2argb_c;594 return yuva2argb_c;
595 case PIX_FMT_RGBA:595 case AV_PIX_FMT_RGBA:
596 case PIX_FMT_BGRA:596 case AV_PIX_FMT_BGRA:
597 if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P)597 if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P)
598 return yuva2rgba_c;598 return yuva2rgba_c;
599 else599 else
600 return yuv2rgb_c_32;600 return yuv2rgb_c_32;
601 case PIX_FMT_RGB24:601 case AV_PIX_FMT_RGB24:
602 return yuv2rgb_c_24_rgb;602 return yuv2rgb_c_24_rgb;
603 case PIX_FMT_BGR24:603 case AV_PIX_FMT_BGR24:
604 return yuv2rgb_c_24_bgr;604 return yuv2rgb_c_24_bgr;
605 case PIX_FMT_RGB565:605 case AV_PIX_FMT_RGB565:
606 case PIX_FMT_BGR565:606 case AV_PIX_FMT_BGR565:
607 case PIX_FMT_RGB555:607 case AV_PIX_FMT_RGB555:
608 case PIX_FMT_BGR555:608 case AV_PIX_FMT_BGR555:
609 return yuv2rgb_c_16;609 return yuv2rgb_c_16;
610 case PIX_FMT_RGB444:610 case AV_PIX_FMT_RGB444:
611 case PIX_FMT_BGR444:611 case AV_PIX_FMT_BGR444:
612 return yuv2rgb_c_12_ordered_dither;612 return yuv2rgb_c_12_ordered_dither;
613 case PIX_FMT_RGB8:613 case AV_PIX_FMT_RGB8:
614 case PIX_FMT_BGR8:614 case AV_PIX_FMT_BGR8:
615 return yuv2rgb_c_8_ordered_dither;615 return yuv2rgb_c_8_ordered_dither;
616 case PIX_FMT_RGB4:616 case AV_PIX_FMT_RGB4:
617 case PIX_FMT_BGR4:617 case AV_PIX_FMT_BGR4:
618 return yuv2rgb_c_4_ordered_dither;618 return yuv2rgb_c_4_ordered_dither;
619 case PIX_FMT_RGB4_BYTE:619 case AV_PIX_FMT_RGB4_BYTE:
620 case PIX_FMT_BGR4_BYTE:620 case AV_PIX_FMT_BGR4_BYTE:
621 return yuv2rgb_c_4b_ordered_dither;621 return yuv2rgb_c_4b_ordered_dither;
622 case PIX_FMT_MONOBLACK:622 case AV_PIX_FMT_MONOBLACK:
623 return yuv2rgb_c_1_ordered_dither;623 return yuv2rgb_c_1_ordered_dither;
624 default:624 default:
625 assert(0);625 assert(0);
@@ -670,25 +670,25 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], · 44 unmodified lines
670 int fullRange, int brightness,670 int fullRange, int brightness,
671 int contrast, int saturation)671 int contrast, int saturation)
672{672{
673 const int isRgb = c->dstFormat == PIX_FMT_RGB32 ||673 const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 ||
674 c->dstFormat == PIX_FMT_RGB32_1 ||674 c->dstFormat == AV_PIX_FMT_RGB32_1 ||
675 c->dstFormat == PIX_FMT_BGR24 ||675 c->dstFormat == AV_PIX_FMT_BGR24 ||
676 c->dstFormat == PIX_FMT_RGB565BE ||676 c->dstFormat == AV_PIX_FMT_RGB565BE ||
677 c->dstFormat == PIX_FMT_RGB565LE ||677 c->dstFormat == AV_PIX_FMT_RGB565LE ||
678 c->dstFormat == PIX_FMT_RGB555BE ||678 c->dstFormat == AV_PIX_FMT_RGB555BE ||
679 c->dstFormat == PIX_FMT_RGB555LE ||679 c->dstFormat == AV_PIX_FMT_RGB555LE ||
680 c->dstFormat == PIX_FMT_RGB444BE ||680 c->dstFormat == AV_PIX_FMT_RGB444BE ||
681 c->dstFormat == PIX_FMT_RGB444LE ||681 c->dstFormat == AV_PIX_FMT_RGB444LE ||
682 c->dstFormat == PIX_FMT_RGB8 ||682 c->dstFormat == AV_PIX_FMT_RGB8 ||
683 c->dstFormat == PIX_FMT_RGB4 ||683 c->dstFormat == AV_PIX_FMT_RGB4 ||
684 c->dstFormat == PIX_FMT_RGB4_BYTE ||684 c->dstFormat == AV_PIX_FMT_RGB4_BYTE ||
685 c->dstFormat == PIX_FMT_MONOBLACK;685 c->dstFormat == AV_PIX_FMT_MONOBLACK;
686 const int isNotNe = c->dstFormat == PIX_FMT_NE(RGB565LE, RGB565BE) ||686 const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) ||
687 c->dstFormat == PIX_FMT_NE(RGB555LE, RGB555BE) ||687 c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) ||
688 c->dstFormat == PIX_FMT_NE(RGB444LE, RGB444BE) ||688 c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) ||
689 c->dstFormat == PIX_FMT_NE(BGR565LE, BGR565BE) ||689 c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) ||
690 c->dstFormat == PIX_FMT_NE(BGR555LE, BGR555BE) ||690 c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) ||
691 c->dstFormat == PIX_FMT_NE(BGR444LE, BGR444BE);691 c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE);
692 const int bpp = c->dstFormatBpp;692 const int bpp = c->dstFormatBpp;
693 uint8_t *y_table;693 uint8_t *y_table;
694 uint16_t *y_table16;694 uint16_t *y_table16;
@@ -856,8 +856,8 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], · 161 unmodified lines
856 fill_gv_table(c->table_gV, 1, cgv);856 fill_gv_table(c->table_gV, 1, cgv);
857 break;857 break;
858 case 32:858 case 32:
859 base = (c->dstFormat == PIX_FMT_RGB32_1 ||859 base = (c->dstFormat == AV_PIX_FMT_RGB32_1 ||
860 c->dstFormat == PIX_FMT_BGR32_1) ? 8 : 0;860 c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0;
861 rbase = base + (isRgb ? 16 : 0);861 rbase = base + (isRgb ? 16 : 0);
862 gbase = base + 8;862 gbase = base + 8;
863 bbase = base + (isRgb ? 0 : 16);863 bbase = base + (isRgb ? 0 : 16);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t