Título artículo / Títol article: H.264/AVC inter prediction on accelerator-based multi-core systems Autores / Autors Rodríguez Sánchez, Rafael ; Martínez, José Luis ; Fernández Escribano, Gerardo ;Sánchez, José L. ; Claver, José M. Revista: Multimedia Tools and Applications, October 2013, Volume 66, Issue 3 Versión / Versió: Post-print del autor Cita bibliográfica / Cita bibliogràfica (ISO 690): RODRÍGUEZ-SÁNCHEZ, Rafael, et al. H. 264/AVC inter prediction on accelerator-based multi-core systems. Multimedia tools and applications, 2013, vol. 66, no 3, p. 361-381. url Repositori UJI: http://hdl.handle.net/10234/92611
H.264/AVC inter prediction on accelerator-based multi-core systems Rafael Rodríguez-Sánchez &José Luis Martínez & Gerardo Fernández-Escribano &José Luis Sánchez & José Manuel Claver #Springer Science+Business Media, LLC 2012 Abstract The AVC video coding standard adopts variable block sizes for inter frame coding to increase compression efficiency, among other new features. As a consequence of this, an AVC encoder has to employ a complex mode decision technique that requires high computational complexity. Several techniques aimed at accelerating the inter prediction process have been proposed in the literature in recent years. Recently, with the emergence of manycore processors or accelerators, a new way of supporting inter frame prediction has presented itself. In this paper, we present a step forward in the implementation of an AVC inter prediction algorithm in a graphics processing unit, using Compute Unified Device Architecture. The results show a negligible drop in rate distortion with a time reduction, on average, of over 98.8 % compared with full search and fast full search, and of over 80 % compared with UMHexagonS search. Keywords AVC .Motion estimation .Inter prediction .Heterogeneous computing Multimed Tools Appl DOI 10.1007/s11042-012-1056-6 R. Rodríguez-Sánchez (*):G. Fernández-Escribano :J. L. Sánchez Instituto de Investigación en Informática de Albacete, Universidad de Castilla-La Mancha, Avenida de España s/n, 02071 Albacete, Spain e-mail: [email protected] G. Fernández-Escribano e-mail: [email protected] J. L. Sánchez e-mail: [email protected] J. L. Martínez Architecture and Technology of Computing Systems Group, Complutense University, Ciudad Universitaria s/n, 28040 Madrid, Spain e-mail: [email protected] J. M. Claver Departamento de Informática, Universidad de Valencia, Avenida de la Universitat s/n, 46100 Burjassot, Valencia, Spain e-mail:
[email protected]
1 Introduction ISO/IEC 14496–10 | ITU-T Rec. H.264 or Advanced Video Coding (AVC) [8] is the newlyestablished video coding standard which represents the best state-of-the-art video compression and achieves much higher compression than the other previously existing video coding standards at the same quality. The main purpose of AVC is to offer a good quality standard able to considerably reduce the output bit rate of the encoded sequences, compared with previous standards, with a view to being used in a variety of applications such as DVD, video-streaming, HDTV, etc., while exhibiting a substantially improved definition of quality and image. AVC promises a significant advance compared with the commercial standards currently most in use (MPEG-2 and MPEG-4) [7]. AVC adopts many video coding techniques, such as multiple reference frames, weighted prediction, a de-blocking filter, variable block size and quarter-pixel precision for motion compensation, which allow this optimum performance to be achieved at the expense of an increase in the computational complexity of the encoder. One of these new features is AVC inter prediction, which supports motion compensation block sizes ranging from 16×16 to 4×4, with many options available between them. AVC inter prediction supports motion compensation block sizes ranging from 16×16, 16×8, 8× 16 to 8×8, where each of the sub-divided regions is a MacroBlock (MB) partition. If the 8× 8 mode is chosen, each of the four 8×8 block partitions within the MB may be further split in 4 ways: 8×8, 8×4, 4×8 or 4×4, which are known as MB sub-partitions. Then, the Motion Compensation (MC) and the Motion Estimation (ME) processes are carried out for each partition and sub-partition, with these processes taking up most of the time of the encoding algorithm. More specifically, ME can take up more than 90 % of the total encoding time. Inter prediction is implemented in the reference software by means of the tree-structured MC algorithm. Therefore, it seems reasonable to accelerate ME in order to reduce the total encoding time. Different computing platforms can be used for this purpose. Interesting cases are the heterogeneous architectures. Examples of this type of platforms include Graphics Processing Units (GPUs), Cell Broadband Engines (Cell BEs), and Field-Programmable Gate Arrays (FPGAs). GPUs, for instance, consist of tens or hundreds of similar processing cores which are designed and organized with the goal of achieving higher performance [5]. The demand for these devices comes primarily from consumer applications, including multimedia and computer or console gaming. The progress of GPUs is now the focus of a great deal of attention. They have changed from fixed pipelines to programmable pipelines, and the hardware design also includes multiple cores, bigger memory sizes and better interconnection networks that offer practical and acceptable solutions for speeding up both graphics and non-graphics applications. GPUs are highly parallel and are normally used as coprocessors to assist the CPU with massive data computations. For example, NVIDIA® has developed a powerful GPU architecture called Compute Unified Device Architecture (CUDA) [15], which consists of a Single Instruction Multiple Data (SIMD) computing device. The main feature of these devices is a large number of processing elements integrated into a single chip at the expense of a significant reduction in cache memory. For instance, the architecture of the NVIDIA® GPUs is organized as a set of SIMD multiprocessors called Stream Multiprocessors (SM). Each SM has multiple processing elements and a set of resources shared by all cores. Each core executes the same instruction at the same clock cycle but on different data. GPUs also have an external DRAM memory which can be classified depending on its access mode. Multimed Tools Appl
The ME algorithm proposed in the AVC encoding algorithm fits well in the GPU philosophy, and offers a new challenge for GPUs. The main issue is how to efficiently distribute all the computations over the GPU. This paper proposes an algorithm to perform the integer-pixel and fractional-pixel ME developed for the AVC over a GPU. In order to evaluate the algorithm, both in terms of time and in terms of Rate Distortion (RD) performance, the algorithm is integrated in the AVC JM reference software, using CUDA. The algorithm obtains on average a speed up of over 86 compared with full search and fast full search, and of over 5 compared with UMHeagonS search. The rest of the paper is organized as follows: Section 2 presents related proposals; the details of the implementation of our approach and its performance evaluation are presented in Sections 3and 4, respectively; finally, the conclusions and future work are set out in Section 5. 2 Related work In the AVC JM reference software, inter prediction is the most computationally-expensive task. It is carried out in two steps: MC and ME. In the literature, many approaches have been proposed in order to accelerate these processes. Most of them are based on estimate data using faster algorithms, aiming to determine which MB partitions are not suitable to be selected for encoding the current MB, based on its characteristics or determining stopping criteria for the MB mode selection algorithms. But, until now, there have not been many solutions which make use of GPUs to accelerate this highly complex algorithm, which is the major focus of this paper: to exploit the powerful GPU architecture to accelerate the AVC JM reference software ME algorithm. In the framework of video processing using GPUs, one of the pioneering approaches was developed by Kelly and Kokaram in 2004 [11]. In this work, the authors propose using computer graphics hardware for fast image interpolation. Basically, the authors implemented the well-known full search block-matching ME algorithm by using the OPENGL API. The results show a speedup of up to fourfold. However, the ME algorithm is only a part of the current video coding standards. In the same year, Chen et al. in [3], exploiting hyperthreading architectures, parallelized the AVC encoding algorithm using the OpenMP programming model for Intel architectures. The authors obtained speedups of up to fourfold. This implementation was not a GPU-based approach but was instead a hyper-threading one. In 2006, Ho et al. in [6] presented an ME algorithm for AVC using GPUs based on a block-by-block approach and providing a mechanism which is able to adjust the arithmetic intensity to maximize performance on different GPUs. In 2007, Lee et al. in [13] presented multi-pass and frame parallel algorithms to accelerate the AVC ME using a GPU. They unroll and rearrange the multiple nested loops involved in the ME algorithm by using the multi-pass method over the GPU. In 2008, Chen and Hang in [2] proposed an implementation of the AVC ME algorithm using CUDA. The algorithm is based on an efficient block-level parallel algorithm for the variable block size ME in AVC. They decompose the AVC ME algorithm into 5 steps so that they can achieve highly parallel computation. Also in 2008, Kung et al. in [12] presented a GPU-based ME for 4×4 blocks. They rearrange the 4×4 block encoding order in order to overcome the dependencies between adjacent MBs. However, AVC defines more block sizes for ME. In 2009, Schwalb et al. in [17] presented a small diamond search ME adapted to the programming model of modern GPUs. They reduce the execution time compared with the Multimed Tools Appl
Unsymmetrical Multi-Hexagon search (UMHexagonS) ME algorithm. The coding efficiency is lower than the one reported by UMHexagonS. In the same year, Momcilovic and Sousa in [14] proposed a scalable parallelization approach for AVC ME. They obtain the Motion Vectors (MVs) by applying efficient data reusing techniques and exploiting the power of the GPUs. Finally in 2010, Cheung et al. in [4] proposed a GPU implementation of the simplified Unsymmetrical Multi-Hexagon search (smpUMHexagonS) ME algorithm. The authors divide the current frame into multiple tiles. Each tile is processed by a single GPU thread, and different tiles are processed by different independent threads concurrently on the GPU. They report significant bitrate increases (12 %) with a penalty in quality (0.4 dB) depending on the sequence and the tile length. The present approach uses the same starting point as [2], but our work (as will be shown below) offers better performance than that obtained in [2]. This is mainly due to an improved usage of memory transfers (our algorithm performs as few memory transfers and allocations as possible, since memory transfers and allocations can degrade the algorithm´s performance), a considerable reduction in bank conflicts and an adequate definition and management of data structures. Moreover, in [2] there are some parts of the algorithm that are not parallelized, such as the seven different MB-partitions, which does not occur in this work. Therefore, the present work improves the AVC ME procedure, creating a more parallel and more efficient procedure. Moreover, the work presented in [2] does not offer RD results, because they only implement the ME algorithm and do not include it in any AVC encoder. Thus, the speedups are meaningless since the quality and bit rate are as important as the time reduction. In a nutshell, there are not many approaches focused on AVC ME implementation in GPUs using CUDA, and most of them do not analyze RD performance. The time reduction, or the speedup, is a very important feature that can be achieved by using GPUs, but all the approaches must keep the RD as close as possible to the reference software, which is a sequential approach to be run on a traditional CPU. Moreover, there are some approaches that do not focus on video coding standards and only try to parallelize a part of them, such as ME. In the AVC video coding standard, ME is only a part of the whole encoding algorithm and, therefore, all the approaches should try to combine all of the coding tools in order to show how this affects the rest of the modules. At this point, the approach presented in this paper offers an implementation of the AVC reference software video-encoding algorithm using a GPU as a coprocessor of the CPU. Our new approach is integrated in the AVC JM 17.2 reference software [9] and offers a high speed up with a negligible RD drop. 3 Proposed inter prediction on CUDA The main challenge of this approach is to efficiently support the tree-structured MC algorithm executed in the AVC JM 17.2 reference software encoder [9] for P frames. The algorithm is divided into two main steps: integer-pixel ME and fractional-pixel ME. Before starting with the execution of the GPU code, some data must be transferred to the GPU DRAM. The data which does not change during the execution is transferred once per sequence and is allocated to the GPU constant memory: frame dimensions, search range, search area dimensions, number of positions inside the search area, and distribution of positions within the search area, which has been changed to exploit locality in memory accesses. Figure 1.a shows the search area distribution used by the JM reference software, Multimed Tools Appl
which follows a spiral pattern and position 0 corresponds to the center of the search area. Figure 1b shows our custom search area distribution, which follows the raster scan order and position 0 corresponds to the top-left corner of the search area and the positions are distributed by rows. Position values shown in Fig. 1b are an example, and they depend on the Search_Range parameter. At the beginning of coding each P frame, the search area MV predictors (MV p s) are calculated and transferred to the GPU DRAM. The search area MV p s are calculated using the motion information from the previous frame, unlike in a sequential execution in which the motion information of neighbor MBs can be used. We use as MV p the 16×16 MVof the MB located in the same position in the previous frame. The frame to be coded and the reference frame are also transferred to the GPU DRAM. 3.1 Integer-pixel motion estimation The proposed algorithm for integer-pixel ME is divided into three steps which need to be executed sequentially following a highly-parallel procedure by using the GPU: calculate 4× 4 Sum of Absolute Differences (SAD) costs, build structured motion tree and perform a reduction. The steps are executed once per frame, obtaining the MVs for all MB partitions and sub-partitions with integer-pixel accuracy, in parallel. The goal of the first step is to obtain the 4×4 SAD-Submatrix for each MB in a frame, as depicted in Fig. 2. For this purpose, a GPU thread is generated for each search area position ((2*Search_Range) 2 search area positions per MB) and 256 threads are grouped into a GPU thread block. Contiguous threads are mapped to contiguous search area positions as depicted in Figs. 1b and 2. The SAD is computed in 4×4 blocks; thus, each thread obtains 16 SAD costs resulting from dividing the MB into 4×4 blocks (b 0 to b 15 in Fig. 2), so a thread obtains all 4×4 SAD costs associated to a certain MB candidate position in the search area. Therefore, each column of the 4×4 SAD-Submatrix depicted in Fig. 2corresponds to one position checked inside the search area, which is calculated by the same GPU thread. Intermediate results for this kernel (4×4 SAD-Submatrix) are stored in GPU registers for faster memory access by the second step. MB 0 1 2 34 56 78 9 10 11 ... ... ... ... 2* Search_Range 2* Search_Range MB 0 256 1 255 511 257 ... ... ... ... ... ... ... 2* Search_Range 2* Search_Range ab Fig. 1 Search area distribution, a) spiral pattern, b) custom pattern Multimed Tools Appl
The second step is performed by the same GPU kernel used to perform the first step. By using the 4×4-block SAD calculations the second step obtains the SAD costs for the different partitions and sub-partitions required in the tree-structured MC algorithm. Figure 3 shows how to build the SAD costs for a given position (Pst) for the different MB partitions and sub-partitions starting with the 4×4 SAD costs. Our algorithm only needs to add two 4× 4 SAD costs to obtain one 8×4 SAD cost and so on. This procedure is possible because we use a common search area for all MB partitions and sub-partitions, unlike a sequential implementation which can calculate separate MV p s and separate search areas for the different MB partitions and sub-partitions. Furthermore, to compute the final costs, the Lagrangian cost equation is used. The Lagrangian cost is defined as SAD costs +ƛ* vector bits , where vector bits is the number of bits required to encode the MV - MV p and ƛ depends on the Quantification Parameter (QP) used to encode the sequences. Intermediate results are stored in multiprocessor local shared memory for the final step. Finally, the same GPU kernel performs a partial reduction (third step) of the generated data. At this point, each thread block contains the motion information for all partitions and sub-partitions for 256 correlative search area positions and applying a binary reduction for each partition/sub-partition obtains the best MV for each partition/sub-partition of the associated positions. Figure 4shows a generic binary reduction in which each thread involved in the reduction procedure (t 0 to t m-1 , where m is the number of threads involved in the reduction procedure) performs a reduction for each row in multiprocessor shared memory (b 0 to b N-1 , where N is the number of rows in multiprocessor shared memory involved in the reduction procedure). Note that m is half of the remaining positions in any of the eight iterations needed to reduce from 256 positions to 1. In order to complete the reduction process, eight iterations are needed, starting with 256 (2 8 ) Lagrangian costs per (2 · Search_Range)2 b0 b1 b2 . . b15 ... P0P1P2· · · P255 4x4 SAD-Submatrix SAD(pixel to pixel) Ref b2Current b2 ... Thread block Thread block Fig. 2 Obtaining 4×4 SAD costs 4x4 8x 4 4x8 8x8 16x8 16x16 Adding2cost Adding2cost Addi ng 2 cost Adding2cost Adding2cost Adding2cost 0 0 0 0 0 0 0 8x16 1 1 1 1 1 1 2 2 2 2 3 3 4 4 4 3 3 5 5 5 6 6 6 7 7 7 89 10 11 12 13 14 15 Pst Pst Pst Pst Pst Pst Pst 0 2 0 1 2 1 3 6 2 3 1 Fig. 3 SAD cost building for different MB partitions Multimed Tools Appl
partition/sub-partition and finishing with one Lagrangian cost per sub-partition, where the SAD-matrix size is reduced by half in each iteration. The reductions are performed with SAD-matrix sizes (S) of 256, 128, 64, 32, 16, 8, 4, and 2 using T strides, such that T 0S/2, to obtain the best Lagrangian cost per block. These strides are chosen to avoid local shared memory bank conflicts. The code for the eight iterations is unrolled to avoid unnecessary loop climbs. Intermediate results are allocated to multiprocessor shared memory. At the end of this kernel, each thread block launched for execution returns the best 41 Lagrangian costs (all MB partitions of the tree-structured MC algorithm) associated to 256 search area positions, and the resulting data is allocated to global GPU memory. An independent GPU kernel performs the final reduction following the same binary reduction explained above. At this point, in GPU global memory there are still (2*Search_Range) 2 /256 Lagrangian costs for each partition/sub-partition. This last kernel performs a final reduction per sub-partition to obtain the best Lagrangian cost for each partition/sub-partition of each MB in a frame. Final results are located in the GPU global memory. When the GPU kernels have been completed, the final results are transferred to CPU main memory. 3.2 Fractional-pixel motion estimation In order to further improve compression, the AVC standard assumes that the best match can be found in a region offset from the current MB (search area) by an integer number of pixels. However, for many MBs a better match can be obtained by searching a region interpolated to sub-pixel accuracy; for this case, a new prediction pixel is created by means of an interpolation of its neighbor. The AVC reference software supports quarter-pixel accuracy, which means that the image sizes are multiplied by four in each dimension or, in other words, one pixel is converted into sixteen sub-pixels. One of these sub-pixels is the pixel with full-pixel b 0 b 1 b 2 . . b N-1 Size S Stride T b 0 b 1 b 2 . . b N-1 Size S/2 Lower per subpartition (t 0 ) SAD-matrix ... ... ... t 0 t 1 t 2 ... t m-1 t 0 t 1 t 2 ... t m-1 Fig. 4 Binary reduction scheme Multimed Tools Appl
accuracy; three of them are the sub-pixels with half-pixel accuracy and the other twelve pixels are the sub-pixels with quarter-pixel accuracy. As mentioned at the beginning of this section, the images are located in GPU DRAM with full-pixel accuracy. So, we need firstly to extend the reference images to sub-pixel accuracy. The sub-pixels with half-pixel accuracy are obtained by means of a 6-tap filter and the sub-pixels with quarter-pixel accuracy are obtained by a bilinear filter. One GPU thread per integer-pixel is generated and it applies both filters to obtain the fifteen sub-pixels. The sub-pixel accuracy ME is performed in two steps: the first one is the half pixel refinement and the second one is the quarter pixel refinement, which are performed for all partitions. The best matching obtained for full-pixel accuracy becomes the center point for half-pixel refinement, and the best matching for half-pixel refinement becomes the center for quarter-pixel refinement. The algorithm for half-pixel and quarter-pixel refinement is the same, but applied over different data. The algorithm for sub-pixel ME is similar to the algorithm used for full-pixel ME: we divide the MB into sixteen 4×4 blocks and each one takes as its starting point the appropriate MV, i.e., all 4×4 blocks will take the same MV to perform the 16×16 partition and the final cost will be obtained using atomic GPU operations. On the other hand, all 4×4 blocks will take different MVs to perform the 4×4 partition and no extra operations will be needed. The same reduction procedure used for full-pixel accuracy ME is used to obtain the best MV. However, there are two important things to take into account here. First, we cannot reuse the motion information from the smallest partition to obtain the Lagrangian cost of the higher partition because each partition has a different starting point (full-pixel MV or halfpixel MV). We have to recalculate the 4×4 cost for each partition. Second, the metric to compute the Lagrangian cost is the Hadamard SAD instead of SAD, as configured for the baseline profile in the AVC JM 17.2 [9] reference software used. Hadamard SAD is more complex than SAD, but it gives better results. 4 Performance evaluation In order to test the performance of the algorithm proposed in this paper, it was integrated in the AVC JM 17.2 reference software encoder [9]. The parameters used in the AVC encoder configuration file were those included in the baseline profile of this reference software. Only some parameters were changed in the configuration file: &The number of reference frames was set to 1 in order to keep the complexity as low as possible, because higher values imply excessive time consumption. An analysis using more reference frames is possible but the conclusions obtained will be the same regardless of the number of reference frames used, because the algorithm is executed as many times as reference frames configured. &RD-Optimization was disabled for the same reason as the NumberReferenceFrames parameter. &The GOP pattern was set to I(11)P. &The tests were carried out with popular sequences in VGA format (640×480), 720p format (1280×720) and 1080p format (1920×1080), so the SourceWidth and Source- Height parameters were changed accordingly. &Depending on the length of the sequence, the parameter FramesToBeEncoded was adjusted in order to encode the full sequence in each case. Multimed Tools Appl
evaluation is not possible because the algorithm is completely different. In [12] the authors only focus on 4×4 blocks for ME and in [14] the authors utilize different metrics to obtain the candidate MVs, namely SAD costs instead of Hadamard SAD costs for sub-pixel accuracy ME, which is less complex than the one we use. In other cases, the encoding conditions are completely different and the comparison is not fair. In [17] the authors use JM9.0 and they do not use Bjøntegaard and Sullivan’s common test rule [18] for RD performance analysis. However, although the authors of [2] only implement the ME algorithm for variable block sizes and do not include it in any AVC encoder (they cannot analyze the RD performance), they report that their algorithm running for CIF sequences and using 16 as search range is executed at 31.54 fps. Our algorithm using the same encoding conditions is executed at 177.5 fps. Note that our GPU is 2.6 times faster than the GPU used in their work. In [4], the authors propose a GPU-based implementation of the well-know smpUMHexagonS ME algorithm. They partition each frame into multiple tiles, where each tile contains one or more MBs and each tile is processed by a single GPU thread. Table 14 shows the RD Table 9 Time reduction of the proposed GPU-based algorithm for 720p sequences Sequence Full Search Fast Full Search UMHexagonS FPS TR% Speed up TR% Speed up TR% Speed up Coral 98.30 58.99 99.05 104.92 71.80 3.55 10.99 Dolphins 98.82 85.01 99.05 104.87 83.18 5.93 10.96 Mobile 99.06 106.84 99.00 100.71 81.78 5.49 10.98 Nile 98.56 69.48 99.04 104.27 73.36 3.75 11.02 Parkrun 99.28 138.04 98.98 97.89 86.36 7.33 10.97 Shields 98.94 94.35 98.99 99.65 83.61 6.10 11.00 Stockholm 98.96 96.37 99.01 101.01 82.80 5.82 11.00 mean 98.85 86.75 99.02 101.84 80.41 5.10 10.99 Table 10 Time reduction of the proposed GPU-based algorithm for 1080p sequences Sequence Full Search Fast Full Search UMHexagonS FPS TR% Speed up TR% Speed up TR% Speed up Blue sky 98.64 73.60 99.06 106.73 80.71 5.18 4.90 Crowd 99.15 117.21 99.01 101.32 83.27 5.98 4.87 Ducks 99.31 145.90 99.00 100.30 84.25 6.35 4.88 Into Tree 99.13 114.36 99.07 107.02 80.33 5.08 4.87 ParkJoy 99.25 133.87 99.02 102.38 85.18 6.75 4.87 Pedestrian 98.59 70.81 99.05 105.36 79.80 4.95 4.90 Riverbed 99.33 149.19 99.04 104.64 89.06 9.14 4.84 Tractor 98.84 85.95 99.03 102.79 85.86 7.07 4.87 mean 99.03 103.03 99.04 103.77 83.56 6.08 4.88 Multimed Tools Appl
results for their algorithm as well as our RD results using the same encoding conditions. We have employed the same 720p sequences sampled at 60 Hz, selecting 64 as the search range and all pictures are encoded as P-frames except the initial I-frame. The comparison is achieved when comparing our results against the reference smpUMHexagonS (implemented in JM) with their results against smpUMHexagonS too. With their implementation, they obtain more degradation as many tiles are used due to the dependencies between neighboring MBs. However, we mitigate the degradation in our approach. Our algorithm outperforms the RD performance obtained by their fastest configurations (90 or more tiles); our algorithm has lower bitrate increments and lower PSNR losses than their algorithm for all video sequences. Table 15 shows the execution time for the experiments carried out to fill the previous Table 14.Table15 also shows the average execution time for each configuration. Note that the peak performance for our GPU is 1350 GFlops and the peak performance for the GPU used in [4] is 345.6 GFlops, which means that our GPU is 3.9 times more powerful. For this reason and for a fair comparison, we have included the column labeled as Index in Table 15,which shows the ratio between the average execution time obtained by their implementation for a certain encoder configuration and the average execution time for our implementation using the same encoder configuration. Higher values than 3.9 for this index mean that our algorithm is faster than their algorithm. In conclusion, our algorithm is as fast as their best configuration (index of 3.85) and it outperforms the execution time for the other configurations (higher index than 3.9). The execution time using 3 and 12 tiles is not specified in [4]; however, we expect a higher execution time than the other tile configuration since they use less GPU threads. 5 Conclusions and future work In this paper an algorithm that concurrently executes the inter prediction performed in the AVC JM 17.2 reference software encoder is presented. Our approach is based on an efficient parallel implementation of the algorithm and its data structures involved in the ME and MC. Exploiting current GPU computational capability provides us with another way to accelerate inter prediction in traditional video codecs, with a view to developing real-time video encoders. Table 11 Two-hour sequence encoding time for VGA sequences Feature JM 17.2 Full Search JM 17.2 Fast Full Search JM 17.2 UMHexagonS Search Proposal fps 0.31 0.32 3.08 6.27 Time (Hours) 193.55 187.50 19.48 9.57 Table 12 Two-hour sequence encoding time for 720p sequences Feature JM 17.2 Full Search JM 17.2 Fast Full Search JM 17.2 UMHexagonS Search Proposal fps 0.12 0.10 1.10 2.10 Time (Hours) 833.33 1000 90.91 47.62 Multimed Tools Appl
Real-time encoding is not achieved in this work. However, future algorithm adaptations for Tesla Data Center Solutions composed of more than one GPU and powerful CPUs could be the starting point to achieve it. Moreover, in an AVC encoder there are other modules that could be good candidates to be adapted to the programming model of modern GPUs, e.g. Intra Prediction. Table 13 Two-hour sequence encoding time for 1080p sequences Feature JM 17.2 Full Search JM 17.2 Fast Full Search JM 17.2 UMHexagonS Search Proposal fps 0.04 0.04 0.43 0.86 Time (Hours) 2500 2500 232.56 116.28 Table 14 RD comparison with Cheung et al. results [4] Number of Tiles Sequence Crew City Harbor Night ΔBitrate (%) ΔPSNR (dB) ΔBitrate (%) ΔPSNR (dB) ΔBitrate (%) ΔPSNR (dB) ΔBitrate (%) ΔPSNR (dB) 3,600 3.14 −0.082 12.93 −0.407 5.58 −0.221 4.64 −0.170 900 3.08 −0.079 11.12 −0.352 2.39 −0.094 3.55 −0.130 225 3.12 −0.080 11.17 −0.350 2.25 −0.089 3.42 −0.125 90 3.22 −0.083 10.82 −0.339 2.21 −0.087 3.40 −0.124 12 0.63 −0.016 1.41 −0.044 0.57 −0.022 1.19 −0.043 3 0.09 −0.003 0.26 −0.008 0.07 −0.003 0.16 −0.006 Our algorithm 3.08 −0.071 6.68 −0.309 0.88 −0.028 1.55 −0.047 Table 15 Execution time comparison with Cheung et al. results [4] Number of Tiles Sequence Average GPU time (ms) Index Crew City Harbor Night GPU Time (ms) GPU Time (ms) GPU Time (ms) GPU Time (ms) 3,600 835.05 927.32 1,248.95 1,688.50 1,174.95 3.85 900 959.16 1,005.55 1,341.45 1,975.95 1,320.53 4.33 225 2,169.25 2,108.71 2,763.79 4,175.44 2,804.30 9.19 90 4,373.63 4,165.28 5,318.38 6,920.73 5,194.51 17.02 12 Unknown 3 Our algorithm 305.09 306.16 304.96 304.71 305.23 Multimed Tools Appl
The algorithm’s good performance is mainly due to an optimized usage of memory transfers, a significant reduction in shared memory bank conflicts and an adequate definition and management of data structures. The results show a considerable time reduction of over 98.8 % compared with full search (speedup of over 86) and of over 98.9 % compared with fast full search (speedup of over 98) for all kinds of video content, with negligible RD drop. We should also mention that our algorithm outperforms the encoding efficiency of UMHexagonS search while obtaining a time reduction of over 82 % (speedup of over 5) for all kinds of video content. Acknowledgments This work was supported by the Spanish MEC and MICINN, as well as European Commission FEDER funds, under Grants CSD2006-00046 and TIN2009-14475-C04. It was also partly supported by The Council of Science and Technology of Castilla-La Mancha under Grants PEII09-0037- 2328, PII2I09-0045-9916, and PCC08-0078-9856. References 1. G. Bjøntegaard, “Calculation of Average PSNR Differences between RD-Curves”, presented at the 13th VCEG-M33 Meeting, Austin (Texas), USA, April 2001. 2. Chen W-N, Hang H-M (2008) H.264/AVC motion estimation implementation on Compute Unified Device Architecture (CUDA). In Proc. of IEEE International Conference on Multimedia and Expo, ICME, pp. 697–700, Hannover, Germany, June 3. Chen YK, Tian X, Ge S, Girkar M (2004) Towards efficient multi-level threading of H.264 encoder on Intel hyper-threading architectures. In Proc. of the 18th International Parallel and Distributed Processing Symposium, pp. 63–72, Santa Fe(New Mexico), USA, April 4. Cheung N-M, Fan X, Au OC, Kung M-C (2010) Video coding on multicore graphics processors. IEEE Signal Process Mag 27(2):79–89 5. Feng W-C, Manocha D (2007) High-performance computing using accelerators. Parallel Computing 33 (10–11):645–647 6. Ho C-W, Au OC, Gary Chan S-H, Yip S-K, Wong H-M (2006) Motion Estimation for H.264/AVC using Programmable Graphics Hardware. In Proc. of IEEE International Conference on Multimedia and Expo, ICME, pp. 2049–2052, Toronto, Canada, July 7. ISO/IEC 14486–2 PDAM1: (1999) Infomation technologygeneric coding of audio-visual objectspart 2: visual 8. ISO/IEC International Standard 14496–10: (2003) Information technology –coding of audio - visual objects –part 10: advanced video coding 9. Joint Video Team (JVT) of ISO/IEC MPEG and ITU-T VCEG, Reference Software to Committee Draft. JVT-F100 JM17.2, 2010. Available on-line at http://iphome.hhi.de/suehring/tml/. 10. JVT Test Model Ad Hoc Group (2003) Evaluation sheet for motion estimation, draft version 4, February 11. Kelly F, Kokaram A (2004) Fast Image Interpolation for Motion Estimation using Graphics Hardware. In Proc. of IS&T/SPIE Electronic Imaging - Real-Time Imaging VIII, vol. 5297, pp. 184–194, San Jose (California), USA, January 2004 12. Kung M-C, Au OC, Wong PHW, Liu CH (2008) Block based parallel motion estimation using programmable graphics hardware. In Proc. of International Conference on Audio, Language and Image Processing, ICALIP, pp. 599–603, Shanghai, China, July 13. Lee C-Y, Lin Y-C, Wu C-L, Chang C-H, Tsao Y-M, Chien S-Y (2007) Multi-pass and frame parallel algorithms of motion estimation in H.264/AVC for Generic GPU. in Proc. of IEEE International Conference on Multimedia and Expo, ICME, pp. 1603–1606, Beijing, China, July 14. Momcilovic S, Sousa L (2009) Development and evaluation of scalable video motion estimators on GPU. in Proc. of IEEE Workshop on Signal Processing Systems, SiPS , pp. 291–296, October Multimed Tools Appl
15. NVIDA (2010) NVIDIA CUDA Compute Unified Device Architecture-Programming Guide, Version 3.2, August 16. Richardson IEG (2003) Video codec design. John Willey & Sons LTD, 2 edition 17. Schwalb M, Ewerth R, Freisleben B (2009) Fast motion estimation on graphics hardware for H.264 video encoding. in IEEE Transaction on Multimedia, vol. II, no. 1, pp. 1–10, January 18. Sullivan G, Bjøntegaard G (2001) Recommended simulation common conditions for H.26L coding efficiency experiments on low-resolution progressive-scan source material. ITU-T VCEG, Doc. VCEG- N81. September Rafael Rodríguez-Sánchez received his M.Sc. degree in Computer Science in 2010 and his B.Sc. degree from the University of Castilla-La Mancha in 2008. He is completing his Ph.D in the Instituto de Investigación en Informática (I3A) in Albacete, Spain. His research interests include video coding and parallel processing. He has 6 publications as author in these areas in refereed conference proceedings. José Luis Martínez (M’07) received his M.Sc. degree in Computer Science in 2007 and the Ph.D. degree from the University of Castilla-La Mancha in 2009. In 2005, he joined the Department of Computer Engineering at the University of Castilla-La Mancha. His research interests include Distributed Video Coding (DVC), video transcoding, quality metrics, Scalable Video Coding (SVC), parallel programming, GPUs among others. He has also been a visiting researcher at the Florida Atlantic University, (USA) and CCSR, at the University of Surrey (UK). He has over 25 publications in these areas in international refereed journals and conference proceedings. He is a member of the IEEE. Multimed Tools Appl
Gerardo Fernández-Escribano (M’05) received his M.Sc. degree in Computer Engineering, in 2003, and the Ph.D. degree from the University of Castilla-La Mancha, Spain, in 2007. In 2004, he joined the Department of Computer Engineering at the University of Castilla-La Mancha. His research interests include multimedia standards, video transcoding, video compression, video transmission, and machine learning mechanisms. He has also been a visiting researcher at the Florida Atlantic University, Boca Raton (USA), and at the Friedrich Alexander Universität, Erlangen-Nuremberg (Germany). Jose L. Sánchez received the PhD degree from the Technical University of Valencia, Spain, in 1998. Since November 1986 he is a member of the Computer Systems Department at the University of Castilla-La Mancha. He is currently an associate professor of computer architecture and technology. His research interests include multicomputer systems, quality of service in high-speed networks, interconnection networks, heterogeneous computing, parallel algorithms and simulation. Multimed Tools Appl
José M. Claver (M’00) received the M.Sc. degree in physics from the University of Valencia, Burjassot, Spain, 1984, and the Ph.D. degree in computer science from the Technical University of Valencia, Valencia, Spain, in 1998. From 1985 to 1990, he was with the Electronics and Computer Architecture Department, University of Castilla-La Mancha, Albacete, Spain. From 1991 to 2007, he was with the Department of Computer Science, Jaume I University, Castellón, Spain. Since 2007, he has been an Associate Professor at the Computing department of the University of Valencia. He has taught undergraduate courses on computer architecture and embedded systems and graduate courses on high-speed networks, advanced computer architecture, and parallel computing. His research interests include computer architecture, parallel computing, high-speed QoS networks, network protocols, embedded systems, and reconfigurable computing. He is the author or coauthor of more than 40 research publications on these subjects. He is an IEEE member. Multimed Tools Appl