GNOME Bugzilla – Bug 687378
Optimize audioconvert on simple endian conversions
Last modified: 2012-12-12 16:54:54 UTC
Created attachment 227843 [details] [review] Optimize audioconvert on simple endian conversions When doing simple endian conversion between S16LE/S16BE and S32BE/S32LE we can do a simple endian swap and nothing more. This patch adds an optimization to handle these cases.
Review of attachment 227843 [details] [review]: Patch forgets to check that signedness is equal. Please ignore.
Created attachment 227872 [details] [review] Optimize audioconvert on simple endian conversions, try 2
Review of attachment 227872 [details] [review]: ::: gst/audioconvert/audioconvert.c @@ +682,3 @@ + /* in some cases we only need to do endian conversion. + * This is a minor optimization to catch that case. */ + ctx->fast_endian_conversion = NULL; Maybe call this ctx->fast_path? @@ +685,3 @@ + if (ctx->mix_passthrough && + GST_AUDIO_FORMAT_INFO_IS_INTEGER (in->finfo) && + GST_AUDIO_FORMAT_INFO_IS_INTEGER (out->finfo) && This will work for floats too @@ +695,3 @@ + } else if (in_depth == 32 && out_depth == 32) { + ctx->fast_endian_conversion = + (AudioConvertFastEndian) audio_convert_orc_32_swap; For S32 the fast paths shouldn't be that useful. audioconvert will already do exactly that with the normal code path. @@ +700,3 @@ + GST_AUDIO_FORMAT_INFO_IS_SIGNED (in->finfo)) { + ctx->fast_endian_conversion = + (AudioConvertFastEndian) audio_convert_orc_s16_s32_swap; This works for unsigned too, and for output_endianness!=G_BYTE_ORDER. Also for $something to S32 native-endianness the normal audioconvert code path will already do exactly this. ::: gst/audioconvert/gstaudioconvertorc.orc @@ +602,3 @@ +swapl d1, s1 + +.function audio_convert_orc_s16_s32_swap There should already be a function that converts S16 non-host-endianness to S32 host-endianness
Are you planning to continue to work on this?
(In reply to comment #4) > Are you planning to continue to work on this? Nope. Feel free to close it.