2
* All Video Processing kernels
3
* Copyright © <2010>, Intel Corporation.
5
* Permission is hereby granted, free of charge, to any person obtaining a
6
* copy of this software and associated documentation files (the
7
* "Software"), to deal in the Software without restriction, including
8
* without limitation the rights to use, copy, modify, merge, publish,
9
* distribute, sub license, and/or sell copies of the Software, and to
10
* permit persons to whom the Software is furnished to do so, subject to
11
* the following conditions:
13
* The above copyright notice and this permission notice (including the
14
* next paragraph) shall be included in all copies or substantial portions
17
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
* This file was originally licensed under the following license
27
* Licensed under the Apache License, Version 2.0 (the "License");
28
* you may not use this file except in compliance with the License.
29
* You may obtain a copy of the License at
31
* http://www.apache.org/licenses/LICENSE-2.0
33
* Unless required by applicable law or agreed to in writing, software
34
* distributed under the License is distributed on an "AS IS" BASIS,
35
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36
* See the License for the specific language governing permissions and
37
* limitations under the License.
42
// Module name: PL8x8_Save_P208.asm
44
// Save entire current planar frame data block of size 16x8
45
//---------------------------------------------------------------
46
// Symbols needed to be defined before including this module
48
// DWORD_ALIGNED_DEST: only if DEST_Y, DEST_U, DEST_V data are DWord aligned
50
//---------------------------------------------------------------
52
#include "PL8x8_Save_P208.inc"
54
mov (8) mMSGHDR<1>:ud rMSGSRC<8;8,1>:ud
56
#if !defined(SAVE_UV_ONLY)
57
// Save current planar frame Y block data (16x8) -------------------------------
59
mov (2) mMSGHDR.0<1>:d wORIX<2;2,1>:w // Block origin
60
mov (1) mMSGHDR.2<1>:ud nDPW_BLOCK_SIZE_Y:ud // Block width and height (16x8)
62
WritePlanarToDataPort:
63
$for(0,0; <nY_NUM_OF_ROWS; 2,1) {
64
mov (16) mubMSGPAYLOAD(%2,0)<1> ub2DEST_Y(%1)REGION(16,2)
65
mov (16) mubMSGPAYLOAD(%2,16)<1> ub2DEST_Y(%1+1)REGION(16,2)
67
send (8) dNULLREG mMSGHDR udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPW_MSG_SIZE_Y+nBI_DESTINATION_Y:ud
70
//** Save 8x8 packed U and V -----------------------------------------------------
71
// we could write directly wORIX to mMSGHDR and then execute asr on it, that way we could
72
// avoid using rMSGSRC as a buffer and have one command less in code, but it is unknown whether
73
//it is possible to do asr on mMSGHDR so we use rMSGSRC.
74
mov (2) rMSGSRC.0<1>:d wORIX<2;2,1>:w // Block origin
76
mov (1) rMSGSRC.2<1>:ud nDPW_BLOCK_SIZE_UV:ud // U/V block width and height (16x4)
77
mov (8) mMSGHDR<1>:ud rMSGSRC<8;8,1>:ud
79
$for(0,0; <nY_NUM_OF_ROWS;2,1) {
80
mov (16) mubMSGPAYLOAD(%2,0)<2> ub2DEST_U(%2)REGION(16,2)
81
mov (16) mubMSGPAYLOAD(%2,1)<2> ub2DEST_V(%2)REGION(16,2)
83
send (8) dNULLREG mMSGHDR udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPW_MSG_SIZE_UV+nBI_DESTINATION_UV:ud
85
//End of PL8x8_Save_P208.asm