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

Side by Side Diff: third_party/opus/src/silk/lin2log.c

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 years, 5 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 | « third_party/opus/src/silk/init_decoder.c ('k') | third_party/opus/src/silk/macros.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 23 matching lines...) Expand all
34 /* Convert input to a log scale */ 34 /* Convert input to a log scale */
35 opus_int32 silk_lin2log( 35 opus_int32 silk_lin2log(
36 const opus_int32 inLin /* I input in linear scale */ 36 const opus_int32 inLin /* I input in linear scale */
37 ) 37 )
38 { 38 {
39 opus_int32 lz, frac_Q7; 39 opus_int32 lz, frac_Q7;
40 40
41 silk_CLZ_FRAC( inLin, &lz, &frac_Q7 ); 41 silk_CLZ_FRAC( inLin, &lz, &frac_Q7 );
42 42
43 /* Piece-wise parabolic approximation */ 43 /* Piece-wise parabolic approximation */
44 return silk_LSHIFT( 31 - lz, 7 ) + silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - frac_Q7 ), 179 ); 44 return silk_ADD_LSHIFT32( silk_SMLAWB( frac_Q7, silk_MUL( frac_Q7, 128 - fra c_Q7 ), 179 ), 31 - lz, 7 );
45 } 45 }
46 46
OLDNEW
« no previous file with comments | « third_party/opus/src/silk/init_decoder.c ('k') | third_party/opus/src/silk/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698