-
Notifications
You must be signed in to change notification settings - Fork 48
/
713.srt
3944 lines (2888 loc) · 85.7 KB
/
713.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:00:00.506 --> 00:00:09.566 A:middle
[ Silence ]
00:00:10.066 --> 00:00:10.866 A:middle
>> Good afternoon.
00:00:11.116 --> 00:00:13.026 A:middle
Welcome to the Accelerate
Framework Session.
00:00:13.726 --> 00:00:14.846 A:middle
My name's Jeff Belcher.
00:00:15.546 --> 00:00:17.536 A:middle
I'm an engineer in the
Vector and Numerics Group.
00:00:18.776 --> 00:00:21.076 A:middle
Today I want to start off
with a pretty common scenario.
00:00:22.036 --> 00:00:24.476 A:middle
Imagine you've got a great
idea for an application,
00:00:24.666 --> 00:00:26.936 A:middle
and that application
has a computationally
00:00:26.936 --> 00:00:27.956 A:middle
intensive component.
00:00:29.516 --> 00:00:31.506 A:middle
You look around and you
find an open source solution
00:00:31.506 --> 00:00:34.546 A:middle
to the problem, you bring
it into your application,
00:00:34.676 --> 00:00:37.916 A:middle
you test it, and you find
the graph's too slow,
00:00:39.076 --> 00:00:40.516 A:middle
or maybe it's a battery drain.
00:00:41.966 --> 00:00:44.526 A:middle
At this point you're forced to
spend the next several hours
00:00:44.526 --> 00:00:47.386 A:middle
or maybe days, profiling
and optimizing that code
00:00:48.446 --> 00:00:50.406 A:middle
to get the performance to
where you need it to be.
00:00:51.796 --> 00:00:53.496 A:middle
We don't think that's right.
00:00:54.026 --> 00:00:55.706 A:middle
The goal of the Accelerate
Framework is
00:00:55.736 --> 00:00:56.976 A:middle
to solve this problem.
00:00:58.496 --> 00:01:01.116 A:middle
The Accelerate Framework is
a collection of functions
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:00:58.496 --> 00:01:01.116 A:middle
The Accelerate Framework is
a collection of functions
00:01:01.116 --> 00:01:04.286 A:middle
of commonly used computationally
intensive operations.
00:01:04.836 --> 00:01:08.436 A:middle
The Accelerate Framework is
designed to be high performance
00:01:08.706 --> 00:01:12.366 A:middle
and deliver great
energy savings for all
00:01:12.366 --> 00:01:13.946 A:middle
of these APIs that
are available.
00:01:14.556 --> 00:01:17.236 A:middle
When you adopt the Accelerate
Framework you're going
00:01:17.236 --> 00:01:20.126 A:middle
to get great performance and
amazing energy characteristics
00:01:20.126 --> 00:01:22.576 A:middle
from the smallest
iPhone all the way
00:01:22.576 --> 00:01:24.216 A:middle
up through the biggest Mac Pro
00:01:24.276 --> 00:01:27.226 A:middle
without changing a single
line of code on your end.
00:01:28.286 --> 00:01:30.546 A:middle
Let's dive into the details
of the Accelerate Framework
00:01:30.546 --> 00:01:33.546 A:middle
and see how it can help you
make a really great app.
00:01:35.696 --> 00:01:37.576 A:middle
So what is the Accelerate
Framework?
00:01:39.156 --> 00:01:41.146 A:middle
When you think Accelerate
Framework there's a few things
00:01:41.146 --> 00:01:42.106 A:middle
that I want you to remember.
00:01:42.766 --> 00:01:45.226 A:middle
First, easy access to
a lot of functionality.
00:01:46.536 --> 00:01:48.636 A:middle
There's more than
2,000 APIs available
00:01:48.636 --> 00:01:49.716 A:middle
on the Accelerate Framework.
00:01:50.346 --> 00:01:52.856 A:middle
Throughout the rest of
the talk we'll break this
00:01:52.886 --> 00:01:54.876 A:middle
down into four easy-to-remember
categories
00:01:54.876 --> 00:01:56.956 A:middle
and show you what
exactly is available.
00:01:57.506 --> 00:01:58.486 A:middle
Think accurate.
00:01:58.606 --> 00:02:03.276 A:middle
We spent a lot of time testing
so that you don't have to.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:01:58.606 --> 00:02:03.276 A:middle
We spent a lot of time testing
so that you don't have to.
00:02:04.196 --> 00:02:06.886 A:middle
The big one is fast
with low energy usage.
00:02:07.646 --> 00:02:09.026 A:middle
You guys really pushed
the limits
00:02:09.026 --> 00:02:12.116 A:middle
of the hardware available today
with your great applications.
00:02:12.726 --> 00:02:14.216 A:middle
When you use the Accelerate
Framework you're going
00:02:14.216 --> 00:02:16.366 A:middle
to get great performance,
and that's going to come
00:02:16.366 --> 00:02:18.506 A:middle
with amazing energy
characteristics.
00:02:19.056 --> 00:02:24.256 A:middle
The best part for you is it
works great on both OS X and iOS
00:02:24.876 --> 00:02:28.426 A:middle
and it's optimized for all
generations of hardware,
00:02:29.066 --> 00:02:30.896 A:middle
so when new hardware
comes out you're not going
00:02:30.896 --> 00:02:35.666 A:middle
to have to revisit your code.
00:02:35.866 --> 00:02:38.106 A:middle
So I mentioned that there's
a lot of functionality
00:02:38.266 --> 00:02:41.106 A:middle
and the Accelerate Framework
is geared toward commonly used
00:02:41.226 --> 00:02:42.856 A:middle
computationally intensive
operations,
00:02:43.166 --> 00:02:44.516 A:middle
but what exactly is available?
00:02:45.246 --> 00:02:47.516 A:middle
We break it down into
these four categories.
00:02:48.446 --> 00:02:52.106 A:middle
First we've got image
processing, with vImage,
00:02:53.536 --> 00:02:57.786 A:middle
we've got digital signal
processing and VVSP,
00:02:57.976 --> 00:03:01.556 A:middle
transcendental math functions
and vForce and vMathLive,
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:02:57.976 --> 00:03:01.556 A:middle
transcendental math functions
and vForce and vMathLive,
00:03:03.106 --> 00:03:06.876 A:middle
and finally, linear
algebra in LAPACK and BLAS.
00:03:07.456 --> 00:03:11.726 A:middle
At the end of this talk
there's a few points
00:03:11.726 --> 00:03:12.966 A:middle
that I want you to
come away with.
00:03:13.906 --> 00:03:16.266 A:middle
The first of these is how the
Accelerate Framework can help
00:03:16.266 --> 00:03:18.146 A:middle
you create a really
great application.
00:03:19.106 --> 00:03:20.706 A:middle
I'm going to show
you some examples
00:03:21.276 --> 00:03:23.336 A:middle
of real world performance
and energy savings
00:03:23.336 --> 00:03:25.026 A:middle
that you can expect
when you utilize the
00:03:25.026 --> 00:03:25.876 A:middle
Accelerate Framework.
00:03:26.446 --> 00:03:29.666 A:middle
I want you to have an
idea of areas of your code
00:03:29.666 --> 00:03:34.216 A:middle
that are likely to benefit
from the Accelerate Framework,
00:03:34.766 --> 00:03:37.736 A:middle
and finally, how to use
the Accelerate Framework.
00:03:37.986 --> 00:03:39.816 A:middle
So this is going to
range from linking
00:03:39.816 --> 00:03:43.066 A:middle
against the Accelerate Framework
up through some tips and tricks
00:03:43.066 --> 00:03:45.056 A:middle
that can really allow
you to get the most
00:03:45.056 --> 00:03:46.426 A:middle
out of the Accelerate Framework.
00:03:46.426 --> 00:03:51.736 A:middle
I want to move now to why the
Accelerate Framework is fast.
00:03:53.086 --> 00:03:55.546 A:middle
Understanding why the Accelerate
Framework is fast can help
00:03:55.546 --> 00:03:58.296 A:middle
in understanding when and why
to use the Accelerate Framework.
00:03:58.296 --> 00:04:03.366 A:middle
One of the big reasons the
Accelerate Framework is fast is
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:03:58.296 --> 00:04:03.366 A:middle
One of the big reasons the
Accelerate Framework is fast is
00:04:03.366 --> 00:04:05.166 A:middle
we utilize SIMD instructions.
00:04:06.576 --> 00:04:08.656 A:middle
This is Single Instruction
Multiple Data.
00:04:08.656 --> 00:04:12.496 A:middle
For those of you
unfamiliar, if we're trying
00:04:12.496 --> 00:04:15.856 A:middle
to for example add 2 arrays
together, there are instructions
00:04:15.856 --> 00:04:17.216 A:middle
on current hardware
that allow us
00:04:17.216 --> 00:04:19.255 A:middle
to add multiple elements
simultaneously.
00:04:19.886 --> 00:04:23.196 A:middle
For those of you more
familiar with SIMD operations,
00:04:23.736 --> 00:04:25.796 A:middle
on Intel this means
we're taking advantage
00:04:25.796 --> 00:04:28.736 A:middle
of SSE, AVX, and now AVX2.
00:04:30.186 --> 00:04:34.196 A:middle
On ARM we're taking
advantage of NEON.
00:04:34.366 --> 00:04:35.816 A:middle
Utilizing SIMD instructions
00:04:35.816 --> 00:04:38.166 A:middle
in certain situations can
have significant energy
00:04:38.166 --> 00:04:39.346 A:middle
and performance savings.
00:04:40.606 --> 00:04:45.496 A:middle
We also spend a lot of time
matching the microarchitecture
00:04:45.706 --> 00:04:47.486 A:middle
for the complete
Apple hardware lineup.
00:04:48.386 --> 00:04:51.246 A:middle
This includes optimizations
like instruction selection
00:04:51.246 --> 00:04:52.436 A:middle
and instruction scheduling,
00:04:52.486 --> 00:04:56.016 A:middle
as well as software
pipelining and loop unrolling.
00:04:57.516 --> 00:05:00.256 A:middle
So I bring these up because
it requires a certain amount
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:04:57.516 --> 00:05:00.256 A:middle
So I bring these up because
it requires a certain amount
00:05:00.256 --> 00:05:01.666 A:middle
of data before optimizations
00:05:01.666 --> 00:05:03.396 A:middle
like loop unrolling
become beneficial,
00:05:03.916 --> 00:05:05.116 A:middle
so it helps to understand
00:05:05.346 --> 00:05:07.546 A:middle
that this is sometimes
happening behind the scenes
00:05:07.546 --> 00:05:08.576 A:middle
in the Accelerated Framework.
00:05:09.316 --> 00:05:12.746 A:middle
The last reason the
Accelerated Framework is fast is
00:05:12.746 --> 00:05:15.316 A:middle
because it's multithreaded
using GCD.
00:05:16.326 --> 00:05:18.106 A:middle
When it's appropriate we're
going to take advantage
00:05:18.106 --> 00:05:19.416 A:middle
of all the cores available.
00:05:20.676 --> 00:05:25.806 A:middle
So I wanted to talk
about why it's fast
00:05:25.806 --> 00:05:28.466 A:middle
so that you have an
understanding of where some
00:05:28.466 --> 00:05:30.056 A:middle
of the tips for successful use
00:05:30.056 --> 00:05:31.576 A:middle
of the Accelerate
Framework come from.
00:05:32.116 --> 00:05:35.276 A:middle
The first tip is
preparation of your data.
00:05:35.276 --> 00:05:38.416 A:middle
When you prepare your
data there's a few things
00:05:38.416 --> 00:05:39.466 A:middle
that I want you to remember.
00:05:40.426 --> 00:05:42.756 A:middle
The first is if you can
make your data contiguous.
00:05:43.426 --> 00:05:45.466 A:middle
This means that if
you're creating an array,
00:05:45.766 --> 00:05:46.726 A:middle
you want to make that array
00:05:46.726 --> 00:05:48.566 A:middle
such that the elements
are contiguous.
00:05:49.116 --> 00:05:52.466 A:middle
If you're allocating or
have control over the layout
00:05:52.466 --> 00:05:55.126 A:middle
of that buffer and memory, if
you can align the beginning
00:05:55.126 --> 00:05:57.076 A:middle
of that buffer to
16-byte boundary,
00:05:57.076 --> 00:05:58.196 A:middle
that's going to be ideal.
00:05:58.786 --> 00:06:01.916 A:middle
With the Accelerate
Framework we always strive
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:05:58.786 --> 00:06:01.916 A:middle
With the Accelerate
Framework we always strive
00:06:01.916 --> 00:06:03.396 A:middle
to deliver the greatest
performance,
00:06:03.426 --> 00:06:05.606 A:middle
but if you can meet
these recommendations,
00:06:06.236 --> 00:06:09.066 A:middle
in certain situations we
can algorithmically exploit
00:06:09.066 --> 00:06:11.216 A:middle
that to give you
slightly more performance.
00:06:11.606 --> 00:06:16.556 A:middle
The next tip is to
understand the problem size.
00:06:18.756 --> 00:06:21.476 A:middle
Any function call has a
cost associated with it.
00:06:22.436 --> 00:06:24.846 A:middle
The Accelerate Framework
is not immune to this.
00:06:26.216 --> 00:06:27.836 A:middle
On the previous slide
we also saw
00:06:27.836 --> 00:06:29.686 A:middle
that in certain situations
optimizations
00:06:29.686 --> 00:06:31.456 A:middle
like loop unrolling are used.
00:06:31.966 --> 00:06:34.596 A:middle
What this means for you is
00:06:34.596 --> 00:06:37.456 A:middle
that when you're
using really small --
00:06:37.456 --> 00:06:38.916 A:middle
when you're using the
Accelerate Framework
00:06:38.916 --> 00:06:40.306 A:middle
with really small datasets,
00:06:40.806 --> 00:06:43.246 A:middle
it may not deliver
the best performance.
00:06:44.606 --> 00:06:45.716 A:middle
There's not a problem size
00:06:45.716 --> 00:06:47.766 A:middle
that I can say don't use
the Accelerate Framework
00:06:47.766 --> 00:06:49.966 A:middle
for something that's
small; it's going to depend
00:06:49.966 --> 00:06:51.406 A:middle
on the operation
you're performing.
00:06:52.186 --> 00:06:54.916 A:middle
For example, if you're scaling a
vector it might be on the order
00:06:54.916 --> 00:06:56.916 A:middle
of 100 elements; whereas
00:06:56.916 --> 00:06:59.286 A:middle
if you have a more complicated
operation for example,
00:06:59.286 --> 00:07:02.826 A:middle
Matrix Multiply, it could
be as small as 8 elements.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:06:59.286 --> 00:07:02.826 A:middle
Matrix Multiply, it could
be as small as 8 elements.
00:07:04.086 --> 00:07:06.196 A:middle
The best thing you can
do here is to experiment.
00:07:07.116 --> 00:07:08.676 A:middle
The Accelerate Framework
is always going
00:07:08.676 --> 00:07:10.196 A:middle
to deliver the great
functionality,
00:07:10.626 --> 00:07:13.066 A:middle
just for these smaller
problem sizes it may not be the
00:07:13.066 --> 00:07:13.986 A:middle
best performance.
00:07:13.986 --> 00:07:20.596 A:middle
The last tip for successful
use is to do setup once
00:07:20.596 --> 00:07:21.956 A:middle
and destroy once at the end.
00:07:23.066 --> 00:07:25.376 A:middle
There's a handful of operations
in the Accelerate Framework
00:07:25.376 --> 00:07:26.896 A:middle
that require a setup structure.
00:07:28.116 --> 00:07:30.096 A:middle
Creating this setup
structure can be costly
00:07:30.096 --> 00:07:30.986 A:middle
and time-consuming.
00:07:31.496 --> 00:07:34.476 A:middle
These setup structures
are designed
00:07:34.476 --> 00:07:38.836 A:middle
to be used multiple times, so if
you find yourself in a situation
00:07:38.836 --> 00:07:42.576 A:middle
where you need to do these
setups, create the setup,
00:07:42.746 --> 00:07:45.246 A:middle
do all of the computation that
you want to do with that setup,
00:07:45.316 --> 00:07:48.696 A:middle
and then destroy
once at the end.
00:07:48.696 --> 00:07:51.116 A:middle
Throughout the rest of the talk
we'll see some examples of this
00:07:51.116 --> 00:07:52.406 A:middle
and it will become more clear.
00:07:53.066 --> 00:07:57.726 A:middle
Now I want to move on to using
the Accelerate Framework.
00:07:58.376 --> 00:08:00.786 A:middle
For those of you brand new
to the Accelerate Framework,
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:07:58.376 --> 00:08:00.786 A:middle
For those of you brand new
to the Accelerate Framework,
00:08:01.046 --> 00:08:03.896 A:middle
including it is just like
including any other framework.
00:08:04.586 --> 00:08:08.946 A:middle
Here we have a typical Xcode
project, and we're just going
00:08:08.946 --> 00:08:10.706 A:middle
to navigate to the build phases.
00:08:11.876 --> 00:08:13.976 A:middle
In the build phases we're
going to find the link
00:08:13.976 --> 00:08:16.056 A:middle
with the library
section and we're going
00:08:16.056 --> 00:08:17.106 A:middle
to find the Plus button.
00:08:18.276 --> 00:08:20.816 A:middle
This brings up the list
of available frameworks.
00:08:21.396 --> 00:08:24.996 A:middle
The Accelerate Framework's
right at the top,
00:08:24.996 --> 00:08:26.406 A:middle
we'll just select
it and click Add.
00:08:27.276 --> 00:08:32.336 A:middle
And then we can be sure that the
Accelerate Framework is included
00:08:32.336 --> 00:08:33.926 A:middle
in our project because
it's going to show
00:08:33.926 --> 00:08:35.566 A:middle
up in this link the
Library section.
00:08:35.976 --> 00:08:40.385 A:middle
The only other step to using
the Accelerate Framework is
00:08:40.416 --> 00:08:41.446 A:middle
to include the headers.
00:08:41.936 --> 00:08:48.826 A:middle
This is accelerate/accelerate.h.
That's all it takes
00:08:48.826 --> 00:08:50.346 A:middle
to use the Accelerate Framework.
00:08:50.966 --> 00:08:53.276 A:middle
Linking from the Command
line is just as easy.
00:08:53.736 --> 00:08:57.396 A:middle
In your link step simply
include -framework accelerate.
00:08:57.396 --> 00:09:03.256 A:middle
So now I want to dive into the
details of what's available
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:08:57.396 --> 00:09:03.256 A:middle
So now I want to dive into the
details of what's available
00:09:03.256 --> 00:09:04.316 A:middle
in the Accelerate Framework.
00:09:05.176 --> 00:09:06.986 A:middle
I mentioned there's
over 2,000 APIs
00:09:06.986 --> 00:09:10.056 A:middle
and we've got these four
categories so we'll start
00:09:10.056 --> 00:09:11.356 A:middle
to step through these now.
00:09:12.346 --> 00:09:14.076 A:middle
And we'll begin with
image processing.
00:09:16.346 --> 00:09:18.416 A:middle
For image processing
we have vImage,
00:09:18.746 --> 00:09:20.946 A:middle
our vectorized image
processing library.
00:09:21.436 --> 00:09:25.866 A:middle
There's a lot of
functionality in vImage,
00:09:26.066 --> 00:09:28.686 A:middle
and rather than just list it
I put together a short video
00:09:28.686 --> 00:09:30.656 A:middle
to show you some of the
features that are available.
00:09:31.246 --> 00:09:33.916 A:middle
We've got alpha blending
00:09:33.916 --> 00:09:37.976 A:middle
and alpha compositing,
dilation, erosion.
00:09:38.816 --> 00:09:41.706 A:middle
You can create Sobel filters
for form edge detection,
00:09:42.826 --> 00:09:46.916 A:middle
various types of CONVLs
to perform blur, deblur,
00:09:47.446 --> 00:09:52.896 A:middle
or multi-kernel CONVLs,
MaxFilters, MinFilters,
00:09:54.416 --> 00:09:59.646 A:middle
color transformations,
warps and Shears.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:10:00.406 --> 00:10:04.536 A:middle
So this is just some of
what you'll find in vImage.
00:10:05.046 --> 00:10:09.346 A:middle
We also have some great
additions and improvements
00:10:09.766 --> 00:10:13.116 A:middle
in both iOS 7 and OS X.
00:10:13.976 --> 00:10:16.196 A:middle
First we have improved
conversion support.
00:10:17.406 --> 00:10:20.476 A:middle
Conversions are operations
like converting between planar
00:10:20.476 --> 00:10:24.656 A:middle
and chunky data or changing
between a pixel component type,
00:10:24.656 --> 00:10:28.226 A:middle
so an 8-bit image format
to a 16-bit image format
00:10:28.226 --> 00:10:33.556 A:middle
or a floating point image
format, just to name a few.
00:10:33.776 --> 00:10:36.716 A:middle
We also introduced vImage
buffer creation utilities,
00:10:37.826 --> 00:10:39.966 A:middle
so in the tips I talked
about how important it is
00:10:39.966 --> 00:10:43.306 A:middle
to create a buffer,
getting the alignment right
00:10:43.306 --> 00:10:46.246 A:middle
and getting everything
contiguous, so to take some
00:10:46.246 --> 00:10:48.256 A:middle
of the guesswork out
of that for vImage,
00:10:49.056 --> 00:10:50.356 A:middle
we introduced the utilities
00:10:50.356 --> 00:10:53.166 A:middle
where you can just specify
the size of the image,
00:10:53.696 --> 00:10:58.436 A:middle
and this function will create
the appropriately sized buffer
00:10:58.636 --> 00:11:00.556 A:middle
to deliver the maximum
performance.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:10:58.636 --> 00:11:00.556 A:middle
to deliver the maximum
performance.
00:11:03.696 --> 00:11:07.046 A:middle
We also introduced
resampling of 16-bit images,
00:11:08.246 --> 00:11:11.346 A:middle
so all the operations like Warp
and Shear that were available
00:11:11.346 --> 00:11:14.486 A:middle
for 8-bit and floating point
image formats are now available
00:11:14.486 --> 00:11:16.386 A:middle
for 16-bit image
formats as well.
00:11:16.996 --> 00:11:23.216 A:middle
The last addition is streamlined
core graphics interoperability.
00:11:23.506 --> 00:11:26.476 A:middle
This is a big one, and I
want to dive into the details
00:11:26.476 --> 00:11:27.806 A:middle
of this with an example.
00:11:28.466 --> 00:11:31.616 A:middle
So we got the question a lot.
00:11:31.616 --> 00:11:34.826 A:middle
How do I use vImage
with my CGImage ref?
00:11:35.756 --> 00:11:38.276 A:middle
To solve this problem
we introduced two new
00:11:38.276 --> 00:11:39.536 A:middle
utility functions.
00:11:40.096 --> 00:11:43.656 A:middle
To go from CGImage
ref to vImage buffer,
00:11:43.656 --> 00:11:47.416 A:middle
we introduced a utility function
vImage buffer and with CGImage
00:11:48.466 --> 00:11:50.166 A:middle
and for the reverse direction,
00:11:50.166 --> 00:11:53.206 A:middle
we introduced vImage
create CGImage from buffer.
00:11:53.846 --> 00:11:56.746 A:middle
Let's take a look at
an example of this,
00:11:56.856 --> 00:11:58.856 A:middle
and see just how
easy it is to use.
00:11:59.746 --> 00:12:03.646 A:middle
So here we're going
to look at how to go
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:11:59.746 --> 00:12:03.646 A:middle
So here we're going
to look at how to go
00:12:03.646 --> 00:12:06.646 A:middle
from a CGImage ref
to a vImage buffer.
00:12:07.816 --> 00:12:09.636 A:middle
As always, we're going to begin
00:12:09.636 --> 00:12:11.576 A:middle
by including the
Accelerate Framework header
00:12:12.136 --> 00:12:16.116 A:middle
and then we're going to
create an openImage ref.
00:12:16.966 --> 00:12:19.136 A:middle
I'm not going to go through
the details of this here.
00:12:19.136 --> 00:12:21.496 A:middle