You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

594 lines
18KB

  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include <windows.h>
  19. #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
  20. #undef _WIN32_WINNT
  21. #define _WIN32_WINNT 0x0600
  22. #endif
  23. #define DXVA2API_USE_BITFIELDS
  24. #define COBJMACROS
  25. #include <d3d9.h>
  26. #include <dxva2api.h>
  27. #include <initguid.h>
  28. #include "avassert.h"
  29. #include "common.h"
  30. #include "hwcontext.h"
  31. #include "hwcontext_dxva2.h"
  32. #include "hwcontext_internal.h"
  33. #include "imgutils.h"
  34. #include "pixdesc.h"
  35. #include "pixfmt.h"
  36. #include "compat/w32dlfcn.h"
  37. typedef IDirect3D9* WINAPI pDirect3DCreate9(UINT);
  38. typedef HRESULT WINAPI pDirect3DCreate9Ex(UINT, IDirect3D9Ex **);
  39. typedef HRESULT WINAPI pCreateDeviceManager9(UINT *, IDirect3DDeviceManager9 **);
  40. #define FF_D3DCREATE_FLAGS (D3DCREATE_SOFTWARE_VERTEXPROCESSING | \
  41. D3DCREATE_MULTITHREADED | \
  42. D3DCREATE_FPU_PRESERVE)
  43. static const D3DPRESENT_PARAMETERS dxva2_present_params = {
  44. .Windowed = TRUE,
  45. .BackBufferWidth = 640,
  46. .BackBufferHeight = 480,
  47. .BackBufferCount = 0,
  48. .SwapEffect = D3DSWAPEFFECT_DISCARD,
  49. .Flags = D3DPRESENTFLAG_VIDEO,
  50. };
  51. typedef struct DXVA2Mapping {
  52. uint32_t palette_dummy[256];
  53. } DXVA2Mapping;
  54. typedef struct DXVA2FramesContext {
  55. IDirect3DSurface9 **surfaces_internal;
  56. int nb_surfaces_used;
  57. HANDLE device_handle;
  58. IDirectXVideoAccelerationService *service;
  59. D3DFORMAT format;
  60. } DXVA2FramesContext;
  61. typedef struct DXVA2DevicePriv {
  62. HMODULE d3dlib;
  63. HMODULE dxva2lib;
  64. HANDLE device_handle;
  65. IDirect3D9 *d3d9;
  66. IDirect3DDevice9 *d3d9device;
  67. } DXVA2DevicePriv;
  68. static const struct {
  69. D3DFORMAT d3d_format;
  70. enum AVPixelFormat pix_fmt;
  71. } supported_formats[] = {
  72. { MKTAG('N', 'V', '1', '2'), AV_PIX_FMT_NV12 },
  73. { MKTAG('P', '0', '1', '0'), AV_PIX_FMT_P010 },
  74. { D3DFMT_P8, AV_PIX_FMT_PAL8 },
  75. };
  76. DEFINE_GUID(video_decoder_service, 0xfc51a551, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02);
  77. DEFINE_GUID(video_processor_service, 0xfc51a552, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02);
  78. static void dxva2_frames_uninit(AVHWFramesContext *ctx)
  79. {
  80. AVDXVA2DeviceContext *device_hwctx = ctx->device_ctx->hwctx;
  81. AVDXVA2FramesContext *frames_hwctx = ctx->hwctx;
  82. DXVA2FramesContext *s = ctx->internal->priv;
  83. int i;
  84. if (frames_hwctx->decoder_to_release)
  85. IDirectXVideoDecoder_Release(frames_hwctx->decoder_to_release);
  86. if (s->surfaces_internal) {
  87. for (i = 0; i < frames_hwctx->nb_surfaces; i++) {
  88. if (s->surfaces_internal[i])
  89. IDirect3DSurface9_Release(s->surfaces_internal[i]);
  90. }
  91. }
  92. av_freep(&s->surfaces_internal);
  93. if (s->service) {
  94. IDirectXVideoAccelerationService_Release(s->service);
  95. s->service = NULL;
  96. }
  97. if (s->device_handle != INVALID_HANDLE_VALUE) {
  98. IDirect3DDeviceManager9_CloseDeviceHandle(device_hwctx->devmgr, s->device_handle);
  99. s->device_handle = INVALID_HANDLE_VALUE;
  100. }
  101. }
  102. static void dxva2_pool_release_dummy(void *opaque, uint8_t *data)
  103. {
  104. // important not to free anything here--data is a surface object
  105. // associated with the call to CreateSurface(), and these surfaces are
  106. // released in dxva2_frames_uninit()
  107. }
  108. static AVBufferRef *dxva2_pool_alloc(void *opaque, int size)
  109. {
  110. AVHWFramesContext *ctx = (AVHWFramesContext*)opaque;
  111. DXVA2FramesContext *s = ctx->internal->priv;
  112. AVDXVA2FramesContext *hwctx = ctx->hwctx;
  113. if (s->nb_surfaces_used < hwctx->nb_surfaces) {
  114. s->nb_surfaces_used++;
  115. return av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1],
  116. sizeof(*hwctx->surfaces), dxva2_pool_release_dummy, 0, 0);
  117. }
  118. return NULL;
  119. }
  120. static int dxva2_init_pool(AVHWFramesContext *ctx)
  121. {
  122. AVDXVA2FramesContext *frames_hwctx = ctx->hwctx;
  123. AVDXVA2DeviceContext *device_hwctx = ctx->device_ctx->hwctx;
  124. DXVA2FramesContext *s = ctx->internal->priv;
  125. int decode = (frames_hwctx->surface_type == DXVA2_VideoDecoderRenderTarget);
  126. int i;
  127. HRESULT hr;
  128. if (ctx->initial_pool_size <= 0)
  129. return 0;
  130. hr = IDirect3DDeviceManager9_OpenDeviceHandle(device_hwctx->devmgr, &s->device_handle);
  131. if (FAILED(hr)) {
  132. av_log(ctx, AV_LOG_ERROR, "Failed to open device handle\n");
  133. return AVERROR_UNKNOWN;
  134. }
  135. hr = IDirect3DDeviceManager9_GetVideoService(device_hwctx->devmgr,
  136. s->device_handle,
  137. decode ? &video_decoder_service : &video_processor_service,
  138. (void **)&s->service);
  139. if (FAILED(hr)) {
  140. av_log(ctx, AV_LOG_ERROR, "Failed to create the video service\n");
  141. return AVERROR_UNKNOWN;
  142. }
  143. for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++) {
  144. if (ctx->sw_format == supported_formats[i].pix_fmt) {
  145. s->format = supported_formats[i].d3d_format;
  146. break;
  147. }
  148. }
  149. if (i == FF_ARRAY_ELEMS(supported_formats)) {
  150. av_log(ctx, AV_LOG_ERROR, "Unsupported pixel format: %s\n",
  151. av_get_pix_fmt_name(ctx->sw_format));
  152. return AVERROR(EINVAL);
  153. }
  154. s->surfaces_internal = av_mallocz_array(ctx->initial_pool_size,
  155. sizeof(*s->surfaces_internal));
  156. if (!s->surfaces_internal)
  157. return AVERROR(ENOMEM);
  158. hr = IDirectXVideoAccelerationService_CreateSurface(s->service,
  159. ctx->width, ctx->height,
  160. ctx->initial_pool_size - 1,
  161. s->format, D3DPOOL_DEFAULT, 0,
  162. frames_hwctx->surface_type,
  163. s->surfaces_internal, NULL);
  164. if (FAILED(hr)) {
  165. av_log(ctx, AV_LOG_ERROR, "Could not create the surfaces\n");
  166. return AVERROR_UNKNOWN;
  167. }
  168. ctx->internal->pool_internal = av_buffer_pool_init2(sizeof(*s->surfaces_internal),
  169. ctx, dxva2_pool_alloc, NULL);
  170. if (!ctx->internal->pool_internal)
  171. return AVERROR(ENOMEM);
  172. frames_hwctx->surfaces = s->surfaces_internal;
  173. frames_hwctx->nb_surfaces = ctx->initial_pool_size;
  174. return 0;
  175. }
  176. static int dxva2_frames_init(AVHWFramesContext *ctx)
  177. {
  178. AVDXVA2FramesContext *hwctx = ctx->hwctx;
  179. DXVA2FramesContext *s = ctx->internal->priv;
  180. int ret;
  181. if (hwctx->surface_type != DXVA2_VideoDecoderRenderTarget &&
  182. hwctx->surface_type != DXVA2_VideoProcessorRenderTarget) {
  183. av_log(ctx, AV_LOG_ERROR, "Unknown surface type: %lu\n",
  184. hwctx->surface_type);
  185. return AVERROR(EINVAL);
  186. }
  187. s->device_handle = INVALID_HANDLE_VALUE;
  188. /* init the frame pool if the caller didn't provide one */
  189. if (!ctx->pool) {
  190. ret = dxva2_init_pool(ctx);
  191. if (ret < 0) {
  192. av_log(ctx, AV_LOG_ERROR, "Error creating an internal frame pool\n");
  193. return ret;
  194. }
  195. }
  196. return 0;
  197. }
  198. static int dxva2_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
  199. {
  200. frame->buf[0] = av_buffer_pool_get(ctx->pool);
  201. if (!frame->buf[0])
  202. return AVERROR(ENOMEM);
  203. frame->data[3] = frame->buf[0]->data;
  204. frame->format = AV_PIX_FMT_DXVA2_VLD;
  205. frame->width = ctx->width;
  206. frame->height = ctx->height;
  207. return 0;
  208. }
  209. static int dxva2_transfer_get_formats(AVHWFramesContext *ctx,
  210. enum AVHWFrameTransferDirection dir,
  211. enum AVPixelFormat **formats)
  212. {
  213. enum AVPixelFormat *fmts;
  214. fmts = av_malloc_array(2, sizeof(*fmts));
  215. if (!fmts)
  216. return AVERROR(ENOMEM);
  217. fmts[0] = ctx->sw_format;
  218. fmts[1] = AV_PIX_FMT_NONE;
  219. *formats = fmts;
  220. return 0;
  221. }
  222. static void dxva2_unmap_frame(AVHWFramesContext *ctx, HWMapDescriptor *hwmap)
  223. {
  224. IDirect3DSurface9 *surface = (IDirect3DSurface9*)hwmap->source->data[3];
  225. IDirect3DSurface9_UnlockRect(surface);
  226. av_freep(&hwmap->priv);
  227. }
  228. static int dxva2_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src,
  229. int flags)
  230. {
  231. IDirect3DSurface9 *surface = (IDirect3DSurface9*)src->data[3];
  232. DXVA2Mapping *map;
  233. D3DSURFACE_DESC surfaceDesc;
  234. D3DLOCKED_RECT LockedRect;
  235. HRESULT hr;
  236. int i, err, nb_planes;
  237. int lock_flags = 0;
  238. nb_planes = av_pix_fmt_count_planes(dst->format);
  239. hr = IDirect3DSurface9_GetDesc(surface, &surfaceDesc);
  240. if (FAILED(hr)) {
  241. av_log(ctx, AV_LOG_ERROR, "Error getting a surface description\n");
  242. return AVERROR_UNKNOWN;
  243. }
  244. if (!(flags & AV_HWFRAME_MAP_WRITE))
  245. lock_flags |= D3DLOCK_READONLY;
  246. if (flags & AV_HWFRAME_MAP_OVERWRITE)
  247. lock_flags |= D3DLOCK_DISCARD;
  248. hr = IDirect3DSurface9_LockRect(surface, &LockedRect, NULL, lock_flags);
  249. if (FAILED(hr)) {
  250. av_log(ctx, AV_LOG_ERROR, "Unable to lock DXVA2 surface\n");
  251. return AVERROR_UNKNOWN;
  252. }
  253. map = av_mallocz(sizeof(*map));
  254. if (!map) {
  255. err = AVERROR(ENOMEM);
  256. goto fail;
  257. }
  258. err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src,
  259. dxva2_unmap_frame, map);
  260. if (err < 0) {
  261. av_freep(&map);
  262. goto fail;
  263. }
  264. for (i = 0; i < nb_planes; i++)
  265. dst->linesize[i] = LockedRect.Pitch;
  266. av_image_fill_pointers(dst->data, dst->format, surfaceDesc.Height,
  267. (uint8_t*)LockedRect.pBits, dst->linesize);
  268. if (dst->format == AV_PIX_FMT_PAL8)
  269. dst->data[1] = (uint8_t*)map->palette_dummy;
  270. return 0;
  271. fail:
  272. IDirect3DSurface9_UnlockRect(surface);
  273. return err;
  274. }
  275. static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
  276. const AVFrame *src)
  277. {
  278. AVFrame *map;
  279. int ret;
  280. if (src->format != ctx->sw_format)
  281. return AVERROR(ENOSYS);
  282. map = av_frame_alloc();
  283. if (!map)
  284. return AVERROR(ENOMEM);
  285. map->format = dst->format;
  286. ret = dxva2_map_frame(ctx, map, dst, AV_HWFRAME_MAP_WRITE | AV_HWFRAME_MAP_OVERWRITE);
  287. if (ret < 0)
  288. goto fail;
  289. av_image_copy(map->data, map->linesize, src->data, src->linesize,
  290. ctx->sw_format, src->width, src->height);
  291. fail:
  292. av_frame_free(&map);
  293. return ret;
  294. }
  295. static int dxva2_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
  296. const AVFrame *src)
  297. {
  298. AVFrame *map;
  299. ptrdiff_t src_linesize[4], dst_linesize[4];
  300. int ret, i;
  301. if (dst->format != ctx->sw_format)
  302. return AVERROR(ENOSYS);
  303. map = av_frame_alloc();
  304. if (!map)
  305. return AVERROR(ENOMEM);
  306. map->format = dst->format;
  307. ret = dxva2_map_frame(ctx, map, src, AV_HWFRAME_MAP_READ);
  308. if (ret < 0)
  309. goto fail;
  310. for (i = 0; i < 4; i++) {
  311. dst_linesize[i] = dst->linesize[i];
  312. src_linesize[i] = map->linesize[i];
  313. }
  314. av_image_copy_uc_from(dst->data, dst_linesize, map->data, src_linesize,
  315. ctx->sw_format, src->width, src->height);
  316. fail:
  317. av_frame_free(&map);
  318. return ret;
  319. }
  320. static int dxva2_map_from(AVHWFramesContext *ctx,
  321. AVFrame *dst, const AVFrame *src, int flags)
  322. {
  323. int err;
  324. if (dst->format != AV_PIX_FMT_NONE && dst->format != ctx->sw_format)
  325. return AVERROR(ENOSYS);
  326. dst->format = ctx->sw_format;
  327. err = dxva2_map_frame(ctx, dst, src, flags);
  328. if (err < 0)
  329. return err;
  330. err = av_frame_copy_props(dst, src);
  331. if (err < 0)
  332. return err;
  333. return 0;
  334. }
  335. static void dxva2_device_free(AVHWDeviceContext *ctx)
  336. {
  337. AVDXVA2DeviceContext *hwctx = ctx->hwctx;
  338. DXVA2DevicePriv *priv = ctx->user_opaque;
  339. if (hwctx->devmgr && priv->device_handle != INVALID_HANDLE_VALUE)
  340. IDirect3DDeviceManager9_CloseDeviceHandle(hwctx->devmgr, priv->device_handle);
  341. if (hwctx->devmgr)
  342. IDirect3DDeviceManager9_Release(hwctx->devmgr);
  343. if (priv->d3d9device)
  344. IDirect3DDevice9_Release(priv->d3d9device);
  345. if (priv->d3d9)
  346. IDirect3D9_Release(priv->d3d9);
  347. if (priv->d3dlib)
  348. dlclose(priv->d3dlib);
  349. if (priv->dxva2lib)
  350. dlclose(priv->dxva2lib);
  351. av_freep(&ctx->user_opaque);
  352. }
  353. static int dxva2_device_create9(AVHWDeviceContext *ctx, UINT adapter)
  354. {
  355. DXVA2DevicePriv *priv = ctx->user_opaque;
  356. D3DPRESENT_PARAMETERS d3dpp = dxva2_present_params;
  357. D3DDISPLAYMODE d3ddm;
  358. HRESULT hr;
  359. pDirect3DCreate9 *createD3D = (pDirect3DCreate9 *)dlsym(priv->d3dlib, "Direct3DCreate9");
  360. if (!createD3D) {
  361. av_log(ctx, AV_LOG_ERROR, "Failed to locate Direct3DCreate9\n");
  362. return AVERROR_UNKNOWN;
  363. }
  364. priv->d3d9 = createD3D(D3D_SDK_VERSION);
  365. if (!priv->d3d9) {
  366. av_log(ctx, AV_LOG_ERROR, "Failed to create IDirect3D object\n");
  367. return AVERROR_UNKNOWN;
  368. }
  369. IDirect3D9_GetAdapterDisplayMode(priv->d3d9, adapter, &d3ddm);
  370. d3dpp.BackBufferFormat = d3ddm.Format;
  371. hr = IDirect3D9_CreateDevice(priv->d3d9, adapter, D3DDEVTYPE_HAL, GetDesktopWindow(),
  372. FF_D3DCREATE_FLAGS,
  373. &d3dpp, &priv->d3d9device);
  374. if (FAILED(hr)) {
  375. av_log(ctx, AV_LOG_ERROR, "Failed to create Direct3D device\n");
  376. return AVERROR_UNKNOWN;
  377. }
  378. return 0;
  379. }
  380. static int dxva2_device_create9ex(AVHWDeviceContext *ctx, UINT adapter)
  381. {
  382. DXVA2DevicePriv *priv = ctx->user_opaque;
  383. D3DPRESENT_PARAMETERS d3dpp = dxva2_present_params;
  384. D3DDISPLAYMODEEX modeex = {0};
  385. IDirect3D9Ex *d3d9ex = NULL;
  386. IDirect3DDevice9Ex *exdev = NULL;
  387. HRESULT hr;
  388. pDirect3DCreate9Ex *createD3DEx = (pDirect3DCreate9Ex *)dlsym(priv->d3dlib, "Direct3DCreate9Ex");
  389. if (!createD3DEx)
  390. return AVERROR(ENOSYS);
  391. hr = createD3DEx(D3D_SDK_VERSION, &d3d9ex);
  392. if (FAILED(hr))
  393. return AVERROR_UNKNOWN;
  394. IDirect3D9Ex_GetAdapterDisplayModeEx(d3d9ex, adapter, &modeex, NULL);
  395. d3dpp.BackBufferFormat = modeex.Format;
  396. hr = IDirect3D9Ex_CreateDeviceEx(d3d9ex, adapter, D3DDEVTYPE_HAL, GetDesktopWindow(),
  397. FF_D3DCREATE_FLAGS,
  398. &d3dpp, NULL, &exdev);
  399. if (FAILED(hr)) {
  400. IDirect3D9Ex_Release(d3d9ex);
  401. return AVERROR_UNKNOWN;
  402. }
  403. av_log(ctx, AV_LOG_VERBOSE, "Using D3D9Ex device.\n");
  404. priv->d3d9 = (IDirect3D9 *)d3d9ex;
  405. priv->d3d9device = (IDirect3DDevice9 *)exdev;
  406. return 0;
  407. }
  408. static int dxva2_device_create(AVHWDeviceContext *ctx, const char *device,
  409. AVDictionary *opts, int flags)
  410. {
  411. AVDXVA2DeviceContext *hwctx = ctx->hwctx;
  412. DXVA2DevicePriv *priv;
  413. pCreateDeviceManager9 *createDeviceManager = NULL;
  414. unsigned resetToken = 0;
  415. UINT adapter = D3DADAPTER_DEFAULT;
  416. HRESULT hr;
  417. int err;
  418. if (device)
  419. adapter = atoi(device);
  420. priv = av_mallocz(sizeof(*priv));
  421. if (!priv)
  422. return AVERROR(ENOMEM);
  423. ctx->user_opaque = priv;
  424. ctx->free = dxva2_device_free;
  425. priv->device_handle = INVALID_HANDLE_VALUE;
  426. priv->d3dlib = dlopen("d3d9.dll", 0);
  427. if (!priv->d3dlib) {
  428. av_log(ctx, AV_LOG_ERROR, "Failed to load D3D9 library\n");
  429. return AVERROR_UNKNOWN;
  430. }
  431. priv->dxva2lib = dlopen("dxva2.dll", 0);
  432. if (!priv->dxva2lib) {
  433. av_log(ctx, AV_LOG_ERROR, "Failed to load DXVA2 library\n");
  434. return AVERROR_UNKNOWN;
  435. }
  436. createDeviceManager = (pCreateDeviceManager9 *)dlsym(priv->dxva2lib,
  437. "DXVA2CreateDirect3DDeviceManager9");
  438. if (!createDeviceManager) {
  439. av_log(ctx, AV_LOG_ERROR, "Failed to locate DXVA2CreateDirect3DDeviceManager9\n");
  440. return AVERROR_UNKNOWN;
  441. }
  442. if (dxva2_device_create9ex(ctx, adapter) < 0) {
  443. // Retry with "classic" d3d9
  444. err = dxva2_device_create9(ctx, adapter);
  445. if (err < 0)
  446. return err;
  447. }
  448. hr = createDeviceManager(&resetToken, &hwctx->devmgr);
  449. if (FAILED(hr)) {
  450. av_log(ctx, AV_LOG_ERROR, "Failed to create Direct3D device manager\n");
  451. return AVERROR_UNKNOWN;
  452. }
  453. hr = IDirect3DDeviceManager9_ResetDevice(hwctx->devmgr, priv->d3d9device, resetToken);
  454. if (FAILED(hr)) {
  455. av_log(ctx, AV_LOG_ERROR, "Failed to bind Direct3D device to device manager\n");
  456. return AVERROR_UNKNOWN;
  457. }
  458. hr = IDirect3DDeviceManager9_OpenDeviceHandle(hwctx->devmgr, &priv->device_handle);
  459. if (FAILED(hr)) {
  460. av_log(ctx, AV_LOG_ERROR, "Failed to open device handle\n");
  461. return AVERROR_UNKNOWN;
  462. }
  463. return 0;
  464. }
  465. const HWContextType ff_hwcontext_type_dxva2 = {
  466. .type = AV_HWDEVICE_TYPE_DXVA2,
  467. .name = "DXVA2",
  468. .device_hwctx_size = sizeof(AVDXVA2DeviceContext),
  469. .frames_hwctx_size = sizeof(AVDXVA2FramesContext),
  470. .frames_priv_size = sizeof(DXVA2FramesContext),
  471. .device_create = dxva2_device_create,
  472. .frames_init = dxva2_frames_init,
  473. .frames_uninit = dxva2_frames_uninit,
  474. .frames_get_buffer = dxva2_get_buffer,
  475. .transfer_get_formats = dxva2_transfer_get_formats,
  476. .transfer_data_to = dxva2_transfer_data_to,
  477. .transfer_data_from = dxva2_transfer_data_from,
  478. .map_from = dxva2_map_from,
  479. .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_DXVA2_VLD, AV_PIX_FMT_NONE },
  480. };