Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: silk/sum_sqr_shift.c

Issue 882843002: Update to opus-HEAD-66611f1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/opus.git@master
Patch Set: Add the contents of Makefile.mips back. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « silk/structs.h ('k') | silk/tuning_parameters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*********************************************************************** 1 /***********************************************************************
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without 3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions 4 modification, are permitted provided that the following conditions
5 are met: 5 are met:
6 - Redistributions of source code must retain the above copyright notice, 6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer. 7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright 8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the 9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution. 10 documentation and/or other materials provided with the distribution.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 nrg = 0; 46 nrg = 0;
47 shft = 0; 47 shft = 0;
48 len--; 48 len--;
49 for( i = 0; i < len; i += 2 ) { 49 for( i = 0; i < len; i += 2 ) {
50 nrg = silk_SMLABB_ovflw( nrg, x[ i ], x[ i ] ); 50 nrg = silk_SMLABB_ovflw( nrg, x[ i ], x[ i ] );
51 nrg = silk_SMLABB_ovflw( nrg, x[ i + 1 ], x[ i + 1 ] ); 51 nrg = silk_SMLABB_ovflw( nrg, x[ i + 1 ], x[ i + 1 ] );
52 if( nrg < 0 ) { 52 if( nrg < 0 ) {
53 /* Scale down */ 53 /* Scale down */
54 nrg = (opus_int32)silk_RSHIFT_uint( (opus_uint32)nrg, 2 ); 54 nrg = (opus_int32)silk_RSHIFT_uint( (opus_uint32)nrg, 2 );
55 shft = 2; 55 shft = 2;
56 i+=2;
56 break; 57 break;
57 } 58 }
58 } 59 }
59 for( ; i < len; i += 2 ) { 60 for( ; i < len; i += 2 ) {
60 nrg_tmp = silk_SMULBB( x[ i ], x[ i ] ); 61 nrg_tmp = silk_SMULBB( x[ i ], x[ i ] );
61 nrg_tmp = silk_SMLABB_ovflw( nrg_tmp, x[ i + 1 ], x[ i + 1 ] ); 62 nrg_tmp = silk_SMLABB_ovflw( nrg_tmp, x[ i + 1 ], x[ i + 1 ] );
62 nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, (opus_uint32)nrg_tmp, shft ); 63 nrg = (opus_int32)silk_ADD_RSHIFT_uint( nrg, (opus_uint32)nrg_tmp, shft );
63 if( nrg < 0 ) { 64 if( nrg < 0 ) {
64 /* Scale down */ 65 /* Scale down */
65 nrg = (opus_int32)silk_RSHIFT_uint( (opus_uint32)nrg, 2 ); 66 nrg = (opus_int32)silk_RSHIFT_uint( (opus_uint32)nrg, 2 );
(...skipping 10 matching lines...) Expand all
76 if( nrg & 0xC0000000 ) { 77 if( nrg & 0xC0000000 ) {
77 nrg = silk_RSHIFT_uint( (opus_uint32)nrg, 2 ); 78 nrg = silk_RSHIFT_uint( (opus_uint32)nrg, 2 );
78 shft += 2; 79 shft += 2;
79 } 80 }
80 81
81 /* Output arguments */ 82 /* Output arguments */
82 *shift = shft; 83 *shift = shft;
83 *energy = nrg; 84 *energy = nrg;
84 } 85 }
85 86
OLDNEW
« no previous file with comments | « silk/structs.h ('k') | silk/tuning_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698