summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVCCOMM_s.h
blob: 32a0166d7f25475fc9ba572609a051aaefc642c1 (plain)
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
;//
;// 
;// File Name:  armVCCOMM_s.h
;// OpenMAX DL: v1.0.2
;// Revision:   12290
;// Date:       Wednesday, April 9, 2008
;// 
;// (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
;// 
;// 
;//
;// ARM optimized OpenMAX AC header file
;// 
;// Formula used:
;// MACRO for calculating median for three values.



    IF :LNOT::DEF:ARMVCCOMM_S_H
        INCLUDE armCOMM_s.h
    M_VARIANTS      CortexA8, ARM1136JS
    
    IF ARM1136JS :LOR: CortexA8 
     
     ;///*
     ;// * Macro: M_MEDIAN3
     ;// *
     ;// * Description: Finds the median of three numbers
     ;// * 
     ;// * Remarks:
     ;// *
     ;// * Parameters:
     ;// * [in] x     First entry for the list of three numbers.
     ;// * [in] y     Second entry for the list of three numbers.
     ;// *            Input value may be corrupted at the end of
     ;// *            the execution of this macro.
     ;// * [in] z     Third entry of the list of three numbers.
     ;// *            Input value corrupted at the end of the 
     ;// *            execution of this macro.
     ;// * [in] t     Temporary scratch  register.
     ;// * [out]z     Median of the three numbers.       
     ;// */
     
     MACRO

     M_MEDIAN3 $x, $y, $z, $t 
     
     SUBS  $t, $y, $z; // if (y < z)
     ADDLT $z, $z, $t; //  swap y and z
     SUBLT $y, $y, $t;

     ;// Now z' <= y', so there are three cases for the
     ;// median value, depending on x.

     ;// 1) x <= z'      <= y'      : median value is z'
     ;// 2)      z' <= x <= y'      : median value is x
     ;// 3)      z'      <= y' <= x : median value is y'

     CMP   $z, $x;     // if ( x > min(y,z) )
     MOVLT $z, $x;     // ans = x 

     CMP   $x, $y;     // if ( x > max(y,z) )
     MOVGT $z, $y;     // ans = max(y,z)
     
     MEND
    ENDIF      
    
    
        
    ENDIF ;// ARMACCOMM_S_H

 END