GithubHelp home page GithubHelp logo

yumeyao / android_platform_frameworks_av Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 24.36 MB

fork of AOSP. To address 2 issues in *Android Media Service*: 1. speed. 2. text-encoding following standard to resolve tags mojibake issues.

Home Page: https://android.googlesource.com/platform/frameworks/av/

License: Other

Makefile 0.49% C++ 65.78% C 28.23% Objective-C 0.55% Assembly 4.90% Perl 0.03% Shell 0.02%

android_platform_frameworks_av's People

Contributors

1nsun avatar bdcgoogle avatar cco3 avatar chih-hung avatar colincross avatar danalbert avatar enh-google avatar fadden avatar galmacky avatar gkasten avatar iam avatar jason-simmons avatar jefftinker avatar jmtrivi avatar johngro avatar kristianmonsen avatar kruton avatar marcone avatar medialajos avatar mikeandroid avatar mstorsjo avatar narayank avatar nickkral avatar pixelflinger avatar psanketi avatar rjsh avatar rubenbrunk avatar theandi666 avatar wangying1015 avatar xt0032rus avatar

Watchers

 avatar

android_platform_frameworks_av's Issues

Review the behavior of handling text-encodings of tags

The issue has also been reported in AOSP issue tracker as:
https://code.google.com/p/android/issues/detail?id=81428

While discussing(arguing) with AOSP community which solution is right, I'll implement the one that follows the standard strictly here with this ticket created to track the implementation details (like what's in the standard for some format).

I have created a wiki page that is open to everyone for editing. It also serves as a checklist.
https://github.com/yumeyao/android_platform_frameworks_av/wiki/Text-encoding-of-tags-in-formats-reference-list

To help with the research of different formats, you can contribute by leaving a comment here and/or editing the wiki page above.

Improve scanning performance further

Commit 3c2151e has been submitted to address performance.

However. The current way used to find the extension (position and length) in a path is not optimal.
Now it gets the strlen, and scans backward from the end of the string.
The fail-case would be /dir1/dir2/dir3/dir4/dir5/veryveryveryverylonglonglonglonglonglonglonglongpath/without/dots/in/any/part/of/the/path

There're 2 ways to make it better:


Since we know the maximum length of extension we can handle is 5, stop backward scanning if it exceeds this length.

This should be the fastest way but the code is a bit ugly.


In both ARM & x86, it's possible to do both strlen and strrchr at the same time with almost no significant performance lose compared to doing only one. Because doing strrchr always moves the pointer to last (the NULL character), but the pointer is not returned. We can simply skip strlen by subtract the original pointer (points to start of the string) from the final pointer (points to the trailing NULL) to get the length.

ARM reference:
strchr: https://sourceware.org/ml/libc-ports/2011-12/msg00028.html
strrchr is just looping of strchr to find the last one.

Intel x86:
repnz scasb


In x86 the performance of the second way is as fast as the first way except for the cases that there are many dots in the path, like /dir1/a.dir2/b.dir3.dir4.dir5.dir6/a.lot.of.dots.are.fun
In ARM, however, the first way should always be faster.

So I'll go with the first way to implement it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.