Gadgetory


All Cool Mind-blowing Gadgets You Love in One Place

Data Compression as Fast As Possible

2015-03-14
anyone who's ever had to pack for a trip has probably known the frustration of trying to cram almost a suitcase worth of stuff into a backpack I mean sure we could suck it up and leave a few items behind or haul around our bulky luggage with us if they're so important but if we did that then our bag won't fit in the overhead compartment anyway and all we're trying to bring is a few extra pairs of underwear just in case we eat some bad tandoori chicken well that got gross but other than that was pretty much a perfect analogy for why data compression became so important to reduce storage requirements and to improve transfer speeds over standard connections these packaging services are kind of like our roommate who catches us standing on our bag trying to zip it up and says you know you can't just roll your laundry and save like a ton of space right and as it turns out when we try it for ourselves the smug little turd is right not only does all of our stuff now fit but we even have more room to crammed with stuff will never use like that copy of ET the extra-terrestrial that we definitely don't watch every night and cry back on topic obviously data can't be rolled in quite the same manner as slightly pre-warn laundry so coding engineers devised algorithms capable of breaking down longer strings of data into shorter ones then reassembling them later using what they've retained an easy way to describe this would be like breaking down the equation 2 times 2 times 2 times 2 times 2 into 2 to the fifth power which is much faster to write and simpler to articulate but Linus I actually know a thing or two about coding and one of those things is that the use of exponential symbols is simply not possible well first off thankfully we weren't roommates in college I mean talk about smug second you're correct as well while it is possible to write a command string which describes an exponential function it usually isn't much of a space saver so maybe a better way to demonstrate how a compression algorithm works is to use something like a string of X's and O's or zeros and ones if you're catching the similarities here let's say we have a string of eight digits which is spelled out as X X X X X X now an algorithm may look at this and decide that every time it comes across a new digit it will replicate it and then note how many times it's been repeated this would cause our string to transform into the smaller X 3 o 2 X 3 while this did reduce overall size it only managed to do so by 25% which isn't exactly going to allow us to cram our drives full or transfer large files over the internet more efficiently that's where more specifically designed algorithms will come in to strip the code to its most basic form instead simply adding all the X's together by treating each as a value of 1 then listing all the O's followed with a digit count as before then we end up with a string that would look like 302 3 which we can now see as half the size of the original code now obviously this example is rudimentary at best but it gives an idea of how mathematicians are able to achieve and then further improve upon this feat as time goes on now this example would be known as lossless compression all of the original data remains intact and is a requirement for programs or documents but if you're willing to give up some detail in the original file lossy compression algorithms can be used for media files like music and movies as long as you understand that the tighter you cram it the lower the playback quality you'll experience what you can actually learn a little bit more about here in our video specifically about video compression speaking of compression no no not compression ok whatever we've got a new sponsor today on tech wiki freshbooks it's a cloud accounting service and basically the kind of thing that any freelance worker or small business is going to want to know about it's all about making your life easier when it comes to invoicing getting paid and tracking expenses because it's done online it makes invoicing simple your clients can pay you online your expenses are automatically tracked as you spend all the little details about cash flow or all in one place so you know exactly where you stand and it shows a full history of every invoice allows you to check if your client has viewed the invoice and all kinds of cool stuff like that you can even update your FreshBooks timesheet from your phone and pull project hours right into an invoice so you can send that off so you get paid if you're your own boss you be using stuff that makes you feel like a boss and freshbooks is an incredibly easy way of doing all of your billing online so you'll have more time to do the work you actually want to be doing or maybe you don't want to be doing it maybe you just need to do it to eat or whatever the case may be to do your work head over to freshbooks comm slash tech quickie and don't forget to enter tech quickie in the how did you hear about us section because that's important all right thanks guys for watching this video like it if you liked it dislike it if you thought it sucked check out our other channels Linus tech tips and channels super fun where we do super fun stuff comment on the video with suggestions for future videos and as always don't forget to subscribe / follow and all that good stuff if you want to see more videos just like this one
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.